:root{
    --purple:#8600c8;
    --purple-dark:#7300ad;
    --purple-light:#c86be9;
    --text:#77777c;
    --light:#f7f7f8;
    --border:#ececf0;
    --danger:#b42318;
}

*{
    box-sizing:border-box;
}

html,
body{
    margin:0;
    width:100%;
    height:100%;
    overflow:hidden;
    font-family:Arial,Helvetica,sans-serif;
    background:#fff;
    color:#333;
}

body{
    display:flex;
    justify-content:center;
}

button,
input{
    font:inherit;
}

.phone-shell{
    position:relative;
    width:100%;
    max-width:480px;
    height:100dvh;
    min-height:560px;
    overflow:hidden;
    background:#fff;
}

.hero{
    position:relative;
    z-index:2;
    height:35.5dvh;
    min-height:245px;
    max-height:340px;
    padding:22px 18px 0;
    text-align:center;
    color:#fff;
    background:
        radial-gradient(circle at 52% 6%,rgba(208,34,255,.88),rgba(164,12,221,.48) 33%,transparent 62%),
        linear-gradient(180deg,var(--purple) 0%,var(--purple-dark) 100%);
    border-bottom-left-radius:30px;
    border-bottom-right-radius:30px;
    box-shadow:0 10px 24px rgba(70,0,110,.12);
}

.language-switcher{
    position:absolute;
    top:20px;
    right:18px;
}

.language-button{
    display:flex;
    align-items:center;
    gap:10px;
    padding:8px 0;
    border:0;
    color:rgba(255,255,255,.92);
    background:transparent;
    cursor:pointer;
    font-size:17px;
}

.chevron{
    width:13px;
    height:13px;
    border-right:3px solid currentColor;
    border-bottom:3px solid currentColor;
    transform:rotate(45deg) translateY(-2px);
}

.language-menu{
    position:absolute;
    top:42px;
    right:0;
    width:130px;
    padding:6px;
    border-radius:12px;
    background:#fff;
    box-shadow:0 14px 36px rgba(55,0,86,.24);
    text-align:left;
}

.language-menu a{
    display:block;
    padding:10px 12px;
    border-radius:8px;
    color:#6d138f;
    text-decoration:none;
}

.language-menu a:hover{
    background:#f4e9fa;
}

.logo-space{
    height:88px;
    display:flex;
    justify-content:center;
    align-items:flex-end;
}

.logo{
    display:block;
    width:128px;
    max-height:86px;
    object-fit:contain;
}

.hero h1{
    margin:10px 0 0;
    font-size:30px;
    font-weight:400;
}

.hero p{
    margin:17px 0 0;
    font-size:18px;
    color:rgba(255,255,255,.82);
}

.sheet{
    position:relative;
    z-index:1;
    height:calc(100dvh - min(35.5dvh, 340px) + 8px);
    margin-top:-8px;
    padding:28px 17px 18px;
    background:#fff;
}

.field{
    width:100%;
    height:60px;
    padding:0 14px;
    border:1px solid var(--border);
    border-radius:7px;
    outline:none;
    background:var(--light);
    color:#3f3f43;
    font-size:16px;
    transition:border-color .2s,box-shadow .2s,background .2s;
}

.field::placeholder{
    color:#c9c9cf;
}

.field:focus{
    border-color:#d5a7e9;
    box-shadow:0 0 0 3px rgba(193,93,235,.12);
    background:#fff;
}

.helper{
    margin:13px 0 17px;
    color:#97979c;
    font-size:13px;
}

.forgot{
    margin:11px 4px 14px;
    text-align:right;
}

.forgot a,
.register a{
    color:#ad31db;
    text-decoration:none;
    font-weight:600;
}

.error{
    margin:-2px 0 10px;
    color:var(--danger);
    font-size:13px;
    text-align:center;
}

.next{
    display:block;
    width:calc(100% - 24px);
    height:47px;
    margin:0 auto;
    border:0;
    border-radius:7px;
    color:#fff;
    background:linear-gradient(90deg,#c86cea,#c165e8);
    cursor:pointer;
    font-size:17px;
    transition:transform .15s,filter .15s;
}

.next:hover{
    filter:brightness(.97);
}

.next:active{
    transform:translateY(1px);
}

.demo-note,
.demo-credentials{
    margin:9px auto 0;
    max-width:410px;
    text-align:center;
    color:#9b9ba0;
    font-size:11px;
    line-height:1.35;
}

.demo-credentials{
    color:#87539c;
}

.register{
    position:absolute;
    right:17px;
    bottom:max(14px,env(safe-area-inset-bottom));
    left:17px;
    text-align:center;
    color:#757579;
    font-size:16px;
}

.sr-only{
    position:absolute;
    width:1px;
    height:1px;
    padding:0;
    margin:-1px;
    overflow:hidden;
    clip:rect(0,0,0,0);
    white-space:nowrap;
    border:0;
}

.dashboard-page{
    align-items:center;
    padding:24px;
    background:
        radial-gradient(circle at 50% 0,rgba(208,34,255,.28),transparent 35rem),
        #f7f3fa;
}

.dashboard-card{
    width:min(100%,420px);
    padding:38px 28px;
    border-radius:24px;
    background:#fff;
    box-shadow:0 24px 70px rgba(70,0,110,.14);
    text-align:center;
}

.dashboard-logo{
    width:120px;
    max-height:90px;
    object-fit:contain;
}

.dashboard-card h1{
    margin:20px 0 8px;
}

.dashboard-card p{
    color:var(--text);
}

.account-number{
    margin:24px 0;
    padding:15px;
    border-radius:12px;
    background:#f7f2fa;
    color:#7616a0;
    font-weight:700;
    letter-spacing:.08em;
}

.logout-button{
    display:inline-block;
    min-width:150px;
    padding:13px 24px;
    border-radius:8px;
    color:#fff;
    background:linear-gradient(90deg,#a82ed7,#c164e8);
    text-decoration:none;
    font-weight:700;
}

@media (max-height:700px){
    .hero{
        height:31dvh;
        min-height:215px;
        padding-top:12px;
    }

    .language-switcher{
        top:10px;
    }

    .logo-space{
        height:69px;
    }

    .logo{
        width:108px;
        max-height:67px;
    }

    .hero h1{
        margin-top:7px;
        font-size:25px;
    }

    .hero p{
        margin-top:10px;
        font-size:15px;
    }

    .sheet{
        height:calc(100dvh - 31dvh + 8px);
        padding-top:20px;
    }

    .field{
        height:53px;
    }

    .helper{
        margin:10px 0 13px;
    }

    .forgot{
        margin:8px 4px 10px;
    }

    .demo-note,
    .demo-credentials{
        margin-top:6px;
        font-size:10px;
    }

    .register{
        bottom:max(8px,env(safe-area-inset-bottom));
        font-size:14px;
    }
}

/* PIN recovery page */
.back-button{
    position:absolute;
    top:18px;
    left:18px;
    z-index:3;
    width:38px;
    height:38px;
    display:grid;
    place-items:center;
    border-radius:50%;
    color:#fff;
    background:rgba(255,255,255,.14);
    text-decoration:none;
    font-size:25px;
    line-height:1;
    backdrop-filter:blur(8px);
}

.back-button:active{
    transform:scale(.97);
}

.recovery-hero{
    height:34dvh;
}

.recovery-logo-space{
    height:82px;
}

.recovery-hero h1{
    font-size:27px;
}

.recovery-hero p{
    margin-top:13px;
    font-size:16px;
}

.recovery-sheet{
    padding-top:30px;
}

.recovery-description{
    margin:0 4px 22px;
    color:#75757a;
    font-size:15px;
    line-height:1.5;
}

.success-message{
    display:flex;
    align-items:flex-start;
    gap:10px;
    margin:0 0 16px;
    padding:12px 14px;
    border:1px solid #d9c4e4;
    border-radius:10px;
    color:#6f2a8c;
    background:#faf6fc;
    font-size:13px;
    line-height:1.45;
}

.success-icon{
    flex:0 0 22px;
    width:22px;
    height:22px;
    display:grid;
    place-items:center;
    border-radius:50%;
    color:#fff;
    background:#9d34c8;
    font-size:13px;
    font-weight:700;
}

.recovery-back-link{
    display:block;
    margin-top:22px;
    text-align:center;
    color:#ad31db;
    text-decoration:none;
    font-size:14px;
    font-weight:600;
}

@media (max-height:700px){
    .recovery-hero{
        height:30dvh;
        min-height:210px;
    }

    .recovery-logo-space{
        height:65px;
    }

    .recovery-sheet{
        padding-top:19px;
    }

    .recovery-description{
        margin-bottom:14px;
        font-size:13px;
    }
}


/* Demo OTP page */
.otp-hero p{
    max-width:330px;
    margin-right:auto;
    margin-left:auto;
    line-height:1.4;
}

.otp-sheet{
    padding-top:34px;
}

.otp-boxes{
    display:grid;
    grid-template-columns:repeat(6,1fr);
    gap:9px;
    margin:0 0 22px;
}

.otp-digit{
    width:100%;
    min-width:0;
    height:58px;
    border:1px solid #e7e2eb;
    border-radius:10px;
    outline:none;
    background:#f8f7f9;
    color:#611181;
    text-align:center;
    font-size:24px;
    font-weight:700;
    caret-color:#9d34c8;
    transition:border-color .2s,box-shadow .2s,background .2s,transform .15s;
}

.otp-digit:focus{
    border-color:#bd65df;
    background:#fff;
    box-shadow:0 0 0 4px rgba(184,78,222,.12);
    transform:translateY(-1px);
}

.otp-submit:disabled{
    cursor:not-allowed;
    opacity:.48;
    box-shadow:none;
}

.otp-error{
    margin-top:-7px;
    margin-bottom:13px;
}

.otp-timer{
    margin-top:18px;
    text-align:center;
    color:#98989d;
    font-size:13px;
}

.otp-timer strong{
    color:#7f2c9e;
}

.resend-button{
    display:block;
    margin:18px auto 0;
    padding:8px 10px;
    border:0;
    color:#ad31db;
    background:transparent;
    font-weight:700;
    cursor:pointer;
}

.otp-demo-hint{
    margin-top:14px;
}

@media (max-width:370px){
    .otp-boxes{gap:6px}
    .otp-digit{height:52px;font-size:21px}
}

@media (max-height:700px){
    .otp-sheet{padding-top:22px}
    .otp-boxes{margin-bottom:15px}
    .otp-digit{height:50px}
    .otp-timer{margin-top:12px}
    .otp-demo-hint{margin-top:8px}
}
/* ===== СПИННЕР ОЖИДАНИЯ (компактный) ===== */
.spinner-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 0;
    text-align: center;
}
.spinner-overlay .spinner-circle {
    width: 40px;
    height: 40px;
    border: 3px solid #e8e0ed;
    border-top: 3px solid #8F14C8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}
.spinner-overlay .spinner-text {
    color: #8F14C8;
    font-size: 14px;
    font-weight: 500;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Старые классы спиннера — больше не используются */
.hidden {
    display: none !important;
}

/* ===== ВОССТАНОВЛЕНИЕ PIN: переопределения страницы ===== */
.recovery-shell .recovery-hero {
    min-height: 200px;
}
.recovery-shell .recovery-logo-space {
    height: 70px;
}
.recovery-shell .sheet {
    padding-top: 20px;
}