/* ========================================================================== */
/* Agency Registration — Modern branded registration experience              */
/* ========================================================================== */

:root {
    --ar-navy: #0c1e3d;
    --ar-blue: #1d4ed8;
    --ar-blue-deep: #1e3a8a;
    --ar-blue-soft: #dbeafe;
    --ar-sky: #eff6ff;
    --ar-ink: #0f172a;
    --ar-muted: #64748b;
    --ar-line: #e2e8f0;
    --ar-surface: #ffffff;
    --ar-danger: #dc2626;
    --ar-success: #059669;
    --ar-radius: 1rem;
    --ar-radius-sm: 0.75rem;
    --ar-shadow: 0 20px 50px -24px rgba(15, 23, 42, 0.35);
    --ar-shadow-soft: 0 8px 24px -12px rgba(30, 58, 138, 0.18);
    --ar-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

.agency-registration-body {
    min-height: 100vh;
    margin: 0;
    font-family: 'Vazir', 'Tahoma', sans-serif;
    color: var(--ar-ink);
    background:
        radial-gradient(ellipse 80% 50% at 100% 0%, rgba(29, 78, 216, 0.12), transparent 55%),
        radial-gradient(ellipse 60% 40% at 0% 100%, rgba(14, 165, 233, 0.1), transparent 50%),
        linear-gradient(160deg, #f1f5f9 0%, #e8eef7 45%, #f8fafc 100%);
    overflow-x: hidden;
}

.ar-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.35fr);
}

/* ===================== Brand panel ===================== */
.ar-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.5rem 2.25rem;
    color: #fff;
    background:
        linear-gradient(155deg, rgba(12, 30, 61, 0.92) 0%, rgba(30, 58, 138, 0.88) 55%, rgba(29, 78, 216, 0.85) 100%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"),
        linear-gradient(160deg, #0c1e3d 0%, #1e3a8a 50%, #1d4ed8 100%);
    overflow: hidden;
}

.ar-brand::before,
.ar-brand::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.ar-brand::before {
    width: 280px;
    height: 280px;
    top: -80px;
    left: -60px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.14), transparent 70%);
    animation: ar-float 10s var(--ar-ease) infinite alternate;
}

.ar-brand::after {
    width: 200px;
    height: 200px;
    bottom: 10%;
    right: -40px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.2), transparent 70%);
    animation: ar-float 12s var(--ar-ease) infinite alternate-reverse;
}

@keyframes ar-float {
    from { transform: translateY(0) scale(1); }
    to { transform: translateY(18px) scale(1.05); }
}

.ar-brand-inner {
    position: relative;
    z-index: 1;
}

.ar-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    text-decoration: none;
    color: inherit;
}

.ar-logo-mark {
    width: 3rem;
    height: 3rem;
    border-radius: 0.9rem;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    font-size: 1.15rem;
    transition: transform 0.35s var(--ar-ease);
}

.ar-logo:hover .ar-logo-mark {
    transform: rotate(-6deg) scale(1.05);
}

.ar-logo-text {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.ar-brand-title {
    font-size: clamp(1.75rem, 2.6vw, 2.35rem);
    font-weight: 800;
    line-height: 1.35;
    margin: 0 0 1rem;
    max-width: 18ch;
}

.ar-brand-lead {
    margin: 0 0 2rem;
    font-size: 1rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.82);
    max-width: 34ch;
}

.ar-benefits {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.85rem;
}

.ar-benefits li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.9);
    opacity: 0;
    animation: ar-rise 0.6s var(--ar-ease) forwards;
}

.ar-benefits li:nth-child(1) { animation-delay: 0.15s; }
.ar-benefits li:nth-child(2) { animation-delay: 0.28s; }
.ar-benefits li:nth-child(3) { animation-delay: 0.4s; }

@keyframes ar-rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.ar-benefit-icon {
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
    border-radius: 0.65rem;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 0.85rem;
}

.ar-brand-footer {
    position: relative;
    z-index: 1;
    margin-top: 2.5rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
}

/* ===================== Form panel ===================== */
.ar-main {
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 2rem 1.5rem;
}

.ar-card {
    width: 100%;
    max-width: 720px;
    margin: auto;
    background: var(--ar-surface);
    border-radius: calc(var(--ar-radius) + 0.25rem);
    box-shadow: var(--ar-shadow);
    border: 1px solid rgba(226, 232, 240, 0.9);
    overflow: hidden;
    animation: ar-card-in 0.55s var(--ar-ease);
}

@keyframes ar-card-in {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.ar-card-head {
    padding: 1.75rem 1.75rem 1.25rem;
    border-bottom: 1px solid var(--ar-line);
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.ar-card-head h1 {
    margin: 0 0 0.35rem;
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--ar-ink);
}

.ar-card-head p {
    margin: 0;
    color: var(--ar-muted);
    font-size: 0.92rem;
}

/* Steps */
.ar-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 1.35rem;
}

.ar-step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    text-align: center;
    padding: 0.35rem;
}

.ar-step::before {
    content: '';
    position: absolute;
    top: 1.05rem;
    right: calc(50% + 1.15rem);
    left: calc(-50% + 1.15rem);
    height: 2px;
    background: var(--ar-line);
    z-index: 0;
}

.ar-step:first-child::before {
    display: none;
}

.ar-step.is-done::before,
.ar-step.is-active::before {
    background: linear-gradient(90deg, var(--ar-blue-deep), var(--ar-blue));
}

.ar-step-dot {
    position: relative;
    z-index: 1;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--ar-muted);
    background: #f1f5f9;
    border: 2px solid var(--ar-line);
    transition: all 0.3s var(--ar-ease);
}

.ar-step.is-active .ar-step-dot {
    color: #fff;
    background: var(--ar-blue);
    border-color: var(--ar-blue);
    box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.18);
    transform: scale(1.06);
}

.ar-step.is-done .ar-step-dot {
    color: #fff;
    background: var(--ar-blue-deep);
    border-color: var(--ar-blue-deep);
}

.ar-step-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ar-muted);
    transition: color 0.25s ease;
}

.ar-step.is-active .ar-step-label,
.ar-step.is-done .ar-step-label {
    color: var(--ar-blue-deep);
}

.ar-card-body {
    padding: 1.5rem 1.75rem 1.75rem;
}

.ar-panel {
    display: none;
    animation: ar-panel-in 0.4s var(--ar-ease);
}

.ar-panel.is-active {
    display: block;
}

@keyframes ar-panel-in {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.ar-section-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0 0 1.25rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ar-blue-deep);
}

.ar-section-title span {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.6rem;
    background: var(--ar-sky);
    color: var(--ar-blue);
    font-size: 0.85rem;
}

.ar-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.1rem;
}

.ar-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ar-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.ar-field--full {
    grid-column: 1 / -1;
}

.ar-label {
    font-size: 0.84rem;
    font-weight: 600;
    color: #334155;
}

.ar-req {
    color: var(--ar-danger);
    margin-right: 0.15rem;
}

.ar-input-wrap {
    position: relative;
}

.ar-input-wrap > i {
    position: absolute;
    top: 50%;
    right: 0.9rem;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.85rem;
    pointer-events: none;
    transition: color 0.2s ease;
}

.ar-input-wrap textarea + i,
.ar-input-wrap:has(textarea) > i {
    top: 1rem;
    transform: none;
}

.ar-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.8rem 2.5rem 0.8rem 0.9rem;
    border: 1.5px solid var(--ar-line);
    border-radius: var(--ar-radius-sm);
    background: #fff;
    color: var(--ar-ink);
    font-family: inherit;
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.ar-input:hover {
    border-color: #cbd5e1;
}

.ar-input:focus {
    border-color: var(--ar-blue);
    box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.12);
    background: #fff;
}

.ar-input-wrap:focus-within > i {
    color: var(--ar-blue);
}

.ar-input.is-invalid,
.ar-input.border-red-500 {
    border-color: var(--ar-danger);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.ar-input--textarea {
    min-height: 5.5rem;
    resize: vertical;
    line-height: 1.6;
}

.ar-input-wrap:has(.ar-toggle-pass) .ar-input {
    padding-left: 2.75rem;
}

.ar-toggle-pass {
    position: absolute;
    top: 50%;
    left: 0.65rem;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 0.45rem;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.ar-toggle-pass:hover {
    color: var(--ar-blue);
    background: var(--ar-sky);
}

.ar-error {
    margin: 0;
    font-size: 0.78rem;
    color: var(--ar-danger);
}

.ar-hint {
    margin: 0.35rem 0 0;
    font-size: 0.78rem;
    color: var(--ar-muted);
}

/* Map */
.ar-map-box {
    border: 1.5px solid var(--ar-line);
    border-radius: var(--ar-radius-sm);
    overflow: hidden;
    background: #f8fafc;
}

.ar-map-box .map-container,
#map {
    height: 260px;
    width: 100%;
    border-radius: 0;
}

.ar-coords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.65rem;
}

.ar-coord-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: var(--ar-sky);
    color: var(--ar-blue-deep);
    font-size: 0.75rem;
    font-weight: 600;
}

.ar-coord-pill.is-empty {
    background: #f1f5f9;
    color: var(--ar-muted);
}

/* Notice */
.ar-notice {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.95rem 1rem;
    margin-top: 1.25rem;
    border-radius: var(--ar-radius-sm);
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
    border: 1px solid #bfdbfe;
}

.ar-notice i {
    color: var(--ar-blue);
    margin-top: 0.15rem;
}

.ar-notice strong {
    display: block;
    color: var(--ar-blue-deep);
    font-size: 0.88rem;
    margin-bottom: 0.2rem;
}

.ar-notice p {
    margin: 0;
    color: #1e40af;
    font-size: 0.82rem;
    line-height: 1.65;
}

/* Actions */
.ar-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--ar-line);
}

.ar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--ar-radius-sm);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    border: 0;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s var(--ar-ease), box-shadow 0.2s ease, background 0.2s ease;
}

.ar-btn:active {
    transform: scale(0.98);
}

.ar-btn--ghost {
    background: #f1f5f9;
    color: #334155;
}

.ar-btn--ghost:hover {
    background: #e2e8f0;
}

.ar-btn--primary {
    background: linear-gradient(135deg, var(--ar-blue-deep) 0%, var(--ar-blue) 100%);
    color: #fff;
    box-shadow: 0 10px 20px -10px rgba(29, 78, 216, 0.65);
    min-width: 9.5rem;
}

.ar-btn--primary:hover {
    box-shadow: 0 14px 28px -10px rgba(29, 78, 216, 0.75);
    transform: translateY(-1px);
}

.ar-btn--link {
    background: transparent;
    color: var(--ar-muted);
    padding-inline: 0.5rem;
}

.ar-btn--link:hover {
    color: var(--ar-blue-deep);
}

.ar-actions-right {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-right: auto;
}

/* Success page */
.ar-success-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.ar-success-card {
    width: 100%;
    max-width: 440px;
    background: var(--ar-surface);
    border-radius: calc(var(--ar-radius) + 0.25rem);
    box-shadow: var(--ar-shadow);
    border: 1px solid var(--ar-line);
    padding: 2.25rem 1.75rem;
    text-align: center;
    animation: ar-card-in 0.55s var(--ar-ease);
}

.ar-success-icon {
    width: 4.5rem;
    height: 4.5rem;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 1.5rem;
    background: linear-gradient(145deg, #059669 0%, #0d9488 100%);
    box-shadow: 0 12px 28px -10px rgba(5, 150, 105, 0.55);
    animation: ar-pop 0.55s var(--ar-ease) 0.1s both;
}

@keyframes ar-pop {
    from { opacity: 0; transform: scale(0.7); }
    to { opacity: 1; transform: scale(1); }
}

.ar-success-card h1 {
    margin: 0 0 0.75rem;
    font-size: 1.4rem;
    color: var(--ar-ink);
}

.ar-success-card > p {
    margin: 0 0 1.25rem;
    color: var(--ar-muted);
    line-height: 1.75;
    font-size: 0.92rem;
}

.ar-next-steps {
    text-align: right;
    background: var(--ar-sky);
    border: 1px solid #bfdbfe;
    border-radius: var(--ar-radius-sm);
    padding: 1rem;
    margin-bottom: 1.35rem;
}

.ar-next-steps strong {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--ar-blue-deep);
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.ar-next-steps ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.55rem;
}

.ar-next-steps li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.84rem;
    color: #334155;
}

.ar-next-steps li i {
    width: 1.1rem;
    text-align: center;
}

.ar-success-actions {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.ar-success-actions .ar-btn {
    width: 100%;
}

/* Responsive */
@media (max-width: 960px) {
    .ar-shell {
        grid-template-columns: 1fr;
    }

    .ar-brand {
        padding: 1.75rem 1.5rem 1.5rem;
        min-height: auto;
    }

    .ar-brand-title {
        max-width: none;
        font-size: 1.55rem;
    }

    .ar-brand-lead {
        max-width: none;
        margin-bottom: 1.25rem;
    }

    .ar-benefits {
        grid-template-columns: 1fr;
    }

    .ar-brand-footer {
        display: none;
    }

    .ar-main {
        padding: 0 1rem 1.5rem;
    }

    .ar-card {
        border-radius: var(--ar-radius) var(--ar-radius) calc(var(--ar-radius) + 0.15rem) calc(var(--ar-radius) + 0.15rem);
        margin-top: -0.5rem;
    }
}

@media (max-width: 640px) {
    .ar-grid,
    .ar-grid--3 {
        grid-template-columns: 1fr;
    }

    .ar-card-head,
    .ar-card-body {
        padding-inline: 1.15rem;
    }

    .ar-step-label {
        font-size: 0.65rem;
    }

    .ar-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .ar-actions-right {
        margin-right: 0;
        flex-direction: column;
    }

    .ar-btn {
        width: 100%;
    }

    .ar-map-box .map-container,
    #map {
        height: 220px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ar-brand::before,
    .ar-brand::after,
    .ar-benefits li,
    .ar-card,
    .ar-panel,
    .ar-success-icon {
        animation: none !important;
    }
}
