/* ======================================================
   Auth pages — login, register, forgot, reset, verify-otp
   Built on site-wide tokens; self-contained namespace (.wd-auth-*).
   ====================================================== */

.wd-auth {
    min-height: calc(100vh - 140px);
    padding: 40px 20px 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bone);
    font-family: var(--sans);
    color: var(--ink);
    position: relative;
}

.wd-auth::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -120px;
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, rgba(var(--brass-rgb), .12), transparent 65%);
    border-radius: var(--radius-circle);
    pointer-events: none;
    z-index: 0;
}

.wd-auth::after {
    content: '';
    position: absolute;
    bottom: -100px;
    left: -120px;
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, rgba(var(--brand-rgb), .1), transparent 65%);
    border-radius: var(--radius-circle);
    pointer-events: none;
    z-index: 0;
}

/* ---- Shell (hero + form) ---- */
.wd-auth__shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1120px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: #fff;
    border-radius: var(--radius-3xl);
    overflow: hidden;
    box-shadow: 0 40px 80px -30px rgba(var(--ink-rgb), .25),
                0 0 0 1px rgba(var(--ink-rgb), .04);
}

/* ---- Hero panel (left in RTL = right visually) ---- */
.wd-auth__hero {
    position: relative;
    padding: 60px 48px;
    background: linear-gradient(135deg, var(--ink) 0%, var(--ink-soft) 55%, var(--brand) 100%);
    color: var(--cream);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 48px;
    overflow: hidden;
    isolation: isolate;
}

.wd-auth__hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(var(--cream-rgb), .06) 1px, transparent 1px);
    background-size: 4px 4px;
    pointer-events: none;
    opacity: .4;
    z-index: -1;
}

.wd-auth__hero::after {
    content: '';
    position: absolute;
    top: -120px;
    left: -120px;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(var(--brass-rgb), .2), transparent 65%);
    border-radius: var(--radius-circle);
    pointer-events: none;
    z-index: -1;
}

.wd-auth__brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.wd-auth__brand-mono {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--brand) 0%, var(--ink-deep) 100%);
    border: 1px solid rgba(var(--brass-rgb), .4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--cream);
    font-family: var(--serif);
    font-style: italic;
    font-weight: 700;
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
    box-shadow: 0 12px 30px -8px rgba(var(--brass-rgb), .35);
}

.wd-auth__brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
    gap: 4px;
}

.wd-auth__brand-ar {
    font-family: var(--sans);
    font-weight: 800;
    font-size: 22px;
    color: var(--cream);
}

.wd-auth__brand-en {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: .4em;
    text-transform: uppercase;
    color: var(--brass-soft);
}

.wd-auth__hero-headline {
    font-family: var(--sans);
    font-weight: 800;
    font-size: clamp(28px, 3.2vw, 40px);
    line-height: 1.1;
    letter-spacing: -.01em;
    margin: 0 0 14px;
    color: var(--cream);
}

.wd-auth__hero-headline .accent {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 500;
    color: var(--brass);
}

.wd-auth__hero-lead {
    font-size: 15px;
    line-height: 1.8;
    color: rgba(var(--cream-rgb), .75);
    margin: 0;
    max-width: 420px;
}

.wd-auth__hero-features {
    list-style: none;
    margin: 0;
    padding: 28px 0 0;
    border-top: 1px solid rgba(var(--brass-rgb), .25);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.wd-auth__hero-features li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(var(--cream-rgb), .85);
}

.wd-auth__hero-features li::before {
    content: '';
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    border-radius: var(--radius-circle);
    background: var(--brass);
    color: var(--ink-deep);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B1E2B' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 12px 12px;
}

/* ---- Form panel ---- */
.wd-auth__form {
    padding: 60px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.wd-auth__back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
    text-decoration: none;
    margin-bottom: 32px;
    transition: color .25s ease, transform .25s ease;
    align-self: flex-start;
    font-weight: 500;
}

.wd-auth__back:hover {
    color: var(--brand);
    transform: translateX(4px);
}

.wd-auth__back i {
    font-size: 11px;
}

.wd-auth__title {
    font-family: var(--sans);
    font-weight: 800;
    font-size: clamp(26px, 3vw, 34px);
    line-height: 1.15;
    margin: 0 0 10px;
    color: var(--ink);
    letter-spacing: -.01em;
}

.wd-auth__subtitle {
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--muted);
    margin: 0 0 32px;
}

/* ---- Alert ---- */
.wd-auth__alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.wd-auth__alert i {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.wd-auth__alert--success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success);
}

.wd-auth__alert--danger {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: var(--danger-soft);
}

/* ---- Field ---- */
.wd-auth__field {
    margin-bottom: 20px;
    font-family: var(--sans);
}

.wd-auth__label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 8px;
    letter-spacing: .01em;
}

.wd-auth__label .req {
    color: var(--danger);
    margin-right: 3px;
}

.wd-auth__input {
    width: 100%;
    height: 50px;
    padding: 0 18px;
    border: 1px solid rgba(var(--ink-rgb), .12);
    border-radius: var(--radius-md);
    background: #fff;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 15px;
    transition: border-color .25s ease, box-shadow .25s ease;
}

.wd-auth__input::placeholder {
    color: var(--placeholder);
}

.wd-auth__input:focus {
    outline: none;
    border-color: var(--brass);
    box-shadow: 0 0 0 4px rgba(var(--brass-rgb), .12);
}

.wd-auth__input.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px var(--danger-bg);
}

.wd-auth__error {
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--danger);
    line-height: 1.4;
}

/* ---- Phone composite ---- */
.wd-auth__phone {
    display: flex;
    border: 1px solid rgba(var(--ink-rgb), .12);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #fff;
    transition: border-color .25s ease, box-shadow .25s ease;
    direction: ltr;
}

.wd-auth__phone:focus-within {
    border-color: var(--brass);
    box-shadow: 0 0 0 4px rgba(var(--brass-rgb), .12);
}

.wd-auth__phone-dial {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    background: var(--bone);
    border-left: 1px solid rgba(var(--ink-rgb), .08);
    height: 50px;
    user-select: none;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: .02em;
    font-size: 14px;
}

.wd-auth__phone-flag {
    font-size: 18px;
    line-height: 1;
}

.wd-auth__phone-input {
    flex: 1;
    border: none;
    background: transparent;
    height: 50px;
    padding: 0 14px;
    font-family: var(--sans);
    font-size: 15px;
    color: var(--ink);
    letter-spacing: 1.5px;
    direction: ltr;
    text-align: left;
}

.wd-auth__phone-input::placeholder {
    color: var(--placeholder);
    letter-spacing: 1.5px;
}

.wd-auth__phone-input:focus {
    outline: none;
}

/* ---- Password composite ---- */
.wd-auth__pass {
    position: relative;
}

.wd-auth__pass .wd-auth__input {
    padding-left: 48px;
}

.wd-auth__pass-toggle {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    padding: 0;
    border-radius: var(--radius-xs);
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color .25s ease, background .25s ease;
}

.wd-auth__pass-toggle:hover {
    color: var(--ink);
    background: var(--bone);
}

/* ---- Row: remember + forgot ---- */
.wd-auth__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    flex-wrap: wrap;
    font-size: 14px;
}

.wd-auth__remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    color: var(--ink);
    font-weight: 500;
}

.wd-auth__remember input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--brand);
    cursor: pointer;
}

.wd-auth__forgot {
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
    transition: color .25s ease;
}

.wd-auth__forgot:hover {
    color: var(--brass);
}

/* ---- Submit ---- */
.wd-auth__submit {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 22px;
    background: var(--ink);
    color: var(--cream);
    border: 1px solid var(--ink);
    border-radius: var(--radius-pill);
    font-family: var(--sans);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: background .3s ease, color .3s ease, transform .3s ease;
    margin-top: 4px;
}

.wd-auth__submit:hover:not(:disabled) {
    background: var(--brass);
    color: var(--ink-deep);
    border-color: var(--brass);
    transform: translateY(-1px);
}

.wd-auth__submit:active {
    transform: translateY(0);
}

.wd-auth__submit:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.wd-auth__submit svg {
    width: 16px;
    height: 16px;
    transition: transform .3s ease;
}

.wd-auth__submit:hover:not(:disabled) svg {
    transform: translateX(-4px);
}

/* ---- Footer link ---- */
.wd-auth__footer {
    margin-top: 24px;
    text-align: center;
    font-size: 14px;
    color: var(--muted);
}

.wd-auth__footer a {
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
    margin-right: 4px;
    transition: color .25s ease;
}

.wd-auth__footer a:hover {
    color: var(--brass);
}

/* ---- Upload zone (register) ---- */
.wd-auth__upload {
    position: relative;
    border: 2px dashed rgba(var(--ink-rgb), .18);
    border-radius: var(--radius-lg);
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color .25s ease, background .25s ease, transform .25s ease;
    background: var(--bone);
}

.wd-auth__upload:hover {
    border-color: var(--brass);
    background: rgba(var(--brass-rgb), .05);
}

.wd-auth__upload.is-dragover {
    border-color: var(--brass);
    background: rgba(var(--brass-rgb), .1);
    transform: scale(1.005);
}

.wd-auth__upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.wd-auth__upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    border-radius: var(--radius-circle);
    background: #fff;
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border: 1px solid rgba(var(--ink-rgb), .08);
}

.wd-auth__upload-text {
    font-size: 14px;
    color: var(--ink);
    font-weight: 500;
    margin-bottom: 4px;
}

.wd-auth__upload-text span {
    color: var(--brand);
    text-decoration: underline;
}

.wd-auth__upload-hint {
    font-size: 12px;
    color: var(--muted);
}

.wd-auth__upload-preview {
    margin-top: 14px;
    display: none;
}

.wd-auth__upload.is-filled .wd-auth__upload-icon,
.wd-auth__upload.is-filled .wd-auth__upload-text,
.wd-auth__upload.is-filled .wd-auth__upload-hint {
    display: none;
}

.wd-auth__upload.is-filled .wd-auth__upload-preview {
    display: block;
}

.wd-auth__upload-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-chip);
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.wd-auth__upload-preview .file-name {
    font-size: 13px;
    color: var(--muted);
    margin-top: 8px;
    word-break: break-word;
}

/* ---- OTP input (verify-otp) ---- */
.wd-auth__otp {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 8px;
    direction: ltr;
}

.wd-auth__otp input {
    width: 56px;
    height: 64px;
    text-align: center;
    font-family: var(--serif);
    font-size: 26px;
    font-weight: 700;
    color: var(--ink);
    border: 1px solid rgba(var(--ink-rgb), .15);
    border-radius: var(--radius-md);
    background: #fff;
    transition: border-color .25s ease, box-shadow .25s ease;
}

.wd-auth__otp input:focus {
    outline: none;
    border-color: var(--brass);
    box-shadow: 0 0 0 4px rgba(var(--brass-rgb), .15);
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .wd-auth {
        padding: 24px 16px 40px;
    }

    .wd-auth__shell {
        grid-template-columns: 1fr;
    }

    .wd-auth__hero {
        padding: 40px 28px;
        min-height: auto;
    }

    .wd-auth__hero-features {
        display: none;
    }

    .wd-auth__form {
        padding: 40px 28px;
    }
}

@media (max-width: 480px) {
    .wd-auth__hero {
        padding: 32px 22px;
    }

    .wd-auth__form {
        padding: 32px 22px;
    }

    .wd-auth__otp input {
        width: 44px;
        height: 52px;
        font-size: 22px;
    }
}
