/* login.css — صفحه ورود سامانه فیش حقوقی (هماهنگ با site.js v9.3) */
:root {
    --primary: #1e3a8a;
    --blue: #2563eb;
    --accent: #d97706;
    --success: #059669;
    --card-bg: rgba(255,255,255,.94);
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --danger: #dc2626;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent
}

body.background {
    margin: 0;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    font-family: iransans,Tahoma,Arial,sans-serif;
    background: #0f172a;
    color: var(--text-dark);
    overflow-x: hidden;
}

.full-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden
}

    .full-bg img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        filter: brightness(.38) saturate(1.1);
        transform: scale(1.02)
    }

.app-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px
}

.login-card-container {
    width: 100%;
    max-width: 440px;
    margin: auto 0;
    padding: 12px 0
}

.login-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,.65);
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,.3),0 6px 16px rgba(0,0,0,.15);
}

.card-header-banner {
    background: linear-gradient(135deg,var(--primary),var(--blue));
    padding: 15px 20px;
    text-align: center;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
}

    .card-header-banner .fa {
        margin-left: 6px
    }

.card-body-content {
    padding: 26px 22px 24px
}

/* برند */
.org-branding {
    text-align: center;
    margin-bottom: 22px
}

.imglogos {
    width: 72px;
    height: 72px;
    object-fit: contain;
    margin-bottom: 8px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,.1))
}

.org-name {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    line-height: 1.5
}

.org-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin: 4px 0 0
}

.org-branding .imglogos {
    opacity: 0;
    animation: logoRise 1.1s cubic-bezier(.22,1,.36,1) .15s forwards
}

.org-branding .org-name {
    opacity: 0;
    animation: fadeUp .8s ease .6s forwards
}

.org-branding .org-subtitle {
    opacity: 0;
    animation: fadeUp .8s ease .85s forwards
}

@keyframes logoRise {
    from {
        opacity: 0;
        transform: translateY(60px) scale(.85)
    }

    to {
        opacity: 1;
        transform: none
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

/* فرم */
.form-group-field {
    margin-bottom: 18px
}

.field-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #334155
}

.custom-input {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    background: #f8fafc;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 17px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 2px;
    color: #0f172a;
    outline: none;
    transition: .25s;
}

    .custom-input:focus {
        background: #fff;
        border-color: var(--blue);
        box-shadow: 0 0 0 4px rgba(37,99,235,.15)
    }

.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 50px;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    transition: .2s;
}

    .btn-action:active {
        transform: scale(.98)
    }

    .btn-action:disabled, .btn-action.is-busy {
        opacity: .75;
        cursor: wait
    }

.btn-accent {
    background: linear-gradient(135deg,#f59e0b,var(--accent))
}

    .btn-accent:hover {
        background: linear-gradient(135deg,var(--accent),#b45309)
    }

.btn-success-gradient {
    background: linear-gradient(135deg,#10b981,var(--success))
}

    .btn-success-gradient:hover {
        background: linear-gradient(135deg,var(--success),#047857)
    }

/* مرحله ۲ */
.otp-step-header {
    text-align: center;
    margin-bottom: 16px
}

    .otp-step-header h2 {
        font-size: 14px;
        color: #475569;
        margin: 0 0 10px;
        font-weight: 600;
        line-height: 1.5
    }

.otp-phone-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--border);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    direction: ltr
}

.btn-edit-phone {
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 2px 4px;
    color: var(--blue);
    font-size: 14px
}

/* فیلد OTP: یک input واقعی شفاف روی ۶ کادر نمایشی */
.otp-field {
    position: relative;
    direction: ltr;
    margin: 18px 0 6px;
    height: 56px
}

.otp-real-input {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    opacity: .01;
    border: 0;
    padding: 0;
    background: transparent;
    color: transparent;
    caret-color: transparent;
    font-size: 16px; /* جلوگیری از zoom در iOS */
}

.otp-cells {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    gap: 9px;
    height: 100%;
    pointer-events: none
}

.otp-cell {
    width: 48px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    background: rgba(241,245,249,.75);
    border: 1.5px solid rgba(203,213,225,.9);
    border-radius: 12px;
    transition: .2s;
}

    .otp-cell.is-filled {
        background: #fff;
        border-color: var(--success);
        color: #065f46
    }

.otp-field.is-focused .otp-cell.is-active {
    background: #fff;
    border-color: var(--blue);
    transform: translateY(-2px);
    box-shadow: 0 0 0 4px rgba(37,99,235,.16),0 6px 16px rgba(0,0,0,.08);
}

.otp-field.is-complete .otp-cell {
    border-color: #10b981;
    background: rgba(240,253,244,.95)
}

.otp-field.is-error .otp-cell {
    border-color: var(--danger);
    background: #fef2f2;
    animation: shake .35s
}

.otp-field.is-busy .otp-cell {
    opacity: .6
}

@keyframes shake {
    25% {
        transform: translateX(-4px)
    }

    75% {
        transform: translateX(4px)
    }
}

.loginerror {
    color: var(--danger);
    font-size: 13px;
    font-weight: 600;
    margin: 6px 0 10px;
    text-align: center;
    min-height: 18px
}

.step-enter {
    animation: fadeUp .35s ease
}

/* تایمر */
.otp-timer-section {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px
}

.countdown-badge {
    background: #f1f5f9;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 13px;
    padding: 5px 12px;
    border-radius: 8px;
    border: 1px dashed #cbd5e1
}

    .countdown-badge .fa {
        margin-left: 4px
    }

.btn-resend-link {
    border: 0;
    background: transparent;
    color: var(--blue);
    font: inherit;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px 8px
}

/* فوتر */
#footer {
    margin-top: auto;
    padding: 16px 0;
    text-align: center;
    width: 100%
}

.footer-card {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,.88);
    backdrop-filter: blur(8px);
    padding: 8px 18px;
    border-radius: 30px;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,.4);
    box-shadow: 0 4px 15px rgba(0,0,0,.15);
    transition: .3s;
}

    .footer-card:hover {
        transform: translateY(-2px);
        background: #fff
    }

    .footer-card img {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: static !important;
        flex: 0 0 28px;
        width: 28px !important;
        height: 28px !important;
        min-width: 28px;
        max-width: none !important;
        object-fit: contain
    }

#footer, .footer-card {
    display: inline-flex;
    visibility: visible !important
}

#footer {
    display: block !important;
    position: relative;
    z-index: 2
}

.footer-card span {
    color: #334155;
    font-size: 12px;
    font-weight: 600
}

@media (max-width:768px) {
    #footer .footer-card img {
        display: block !important;
        width: 28px !important;
        height: 28px !important
    }
}

@media (max-width:420px) {
    .otp-cells {
        gap: 6px
    }

    .otp-cell {
        width: 42px;
        height: 52px
    }

    .otp-field {
        height: 52px
    }

    .card-body-content {
        padding: 22px 14px 20px
    }
}

@media (prefers-reduced-motion:reduce) {
    * {
        animation: none !important;
        transition: none !important
    }

    .org-branding .imglogos, .org-branding .org-name, .org-branding .org-subtitle {
        opacity: 1 !important
    }
}
