:root {
    --primary: #4A7CF7;
    --primary-hover: #3A66D9;
    --card-bg: #FFFFFF;
    --text-primary: #1A2332;
    --text-secondary: #5A6B7C;
    --text-tertiary: #94A3B8;
    --border: #C8D2DF;
    --error: #EF4444;
    --error-bg: #FEF2F2;
    --success: #4CAF50;
    --success-bg: #E8F5E9;
    --success-border: #A5D6A7;
    --shadow: 0 16px 48px rgba(0, 20, 50, 0.2);
    --shadow-hover: 0 20px 56px rgba(0, 20, 50, 0.22);
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', Roboto, sans-serif;
    background: #0a0e17;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Анимированный фон */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(74, 124, 247, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(124, 140, 255, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(90, 70, 255, 0.08) 0%, transparent 60%);
    animation: bgShift 15s ease-in-out infinite;
    pointer-events: none;
}

@keyframes bgShift {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Плавающие частицы */
.particle {
    position: fixed;
    border-radius: 50%;
    background: rgba(74, 124, 247, 0.15);
    animation: float 20s infinite ease-in-out;
    pointer-events: none;
}

.particle:nth-child(1) { width: 200px; height: 200px; top: 10%; left: 5%; animation-delay: 0s; }
.particle:nth-child(2) { width: 150px; height: 150px; top: 60%; left: 80%; animation-delay: -5s; }
.particle:nth-child(3) { width: 100px; height: 100px; top: 80%; left: 20%; animation-delay: -10s; }
.particle:nth-child(4) { width: 250px; height: 250px; top: 30%; left: 60%; animation-delay: -15s; }

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -20px) scale(1.1); }
    50% { transform: translate(-20px, 30px) scale(0.9); }
    75% { transform: translate(15px, -15px) scale(1.05); }
}

.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 48px 40px 44px;
    max-width: 520px;
    width: 100%;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 80px rgba(74, 124, 247, 0.15);
    transition: box-shadow 0.3s ease;
    position: relative;
    z-index: 10;
    animation: fadeIn 0.5s ease-out;
}

.card:hover {
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35), 0 0 100px rgba(74, 124, 247, 0.25);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: -0.4px;
}

.subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 360px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

.input-container {
    animation: slideDown 0.4s ease-out;
    margin-bottom: 24px;
}

.input-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    text-align: left;
}

.input-field {
    width: 100%;
    padding: 14px 16px;
    background: #F4F7FC;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-family: inherit;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(74, 124, 247, 0.15);
}

.input-field.error {
    border-color: var(--error);
    background: var(--error-bg);
}

.input-field::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}

.error-message {
    color: var(--error);
    font-size: 14px;
    margin-top: 8px;
    font-weight: 500;
    text-align: left;
    display: none;
    animation: slideDown 0.3s ease-out;
}

.error-message.show {
    display: block;
}

.btn-primary {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #7C8CFF 0%, #5A46FF 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.3px;
    font-family: inherit;
    box-shadow: 0 8px 24px rgba(74, 124, 247, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #6B7EFF 0%, #4A3AD9 100%);
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(74, 124, 247, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-primary:disabled {
    background: #CBD5E1;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Уведомление с кодом: зафиксировано сверху по центру, как пуш-уведомление на телефоне */
.sms-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: min(420px, calc(100vw - 32px));
    z-index: 1000;
    background: var(--success-bg);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--success-border);
    animation: smsIn 0.5s ease;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

@keyframes smsIn {
    from {
        opacity: 0;
        transform: translate(-50%, -80px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.sms-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.sms-icon svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: #FFFFFF;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sms-content {
    flex: 1;
    text-align: left;
}

.sms-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.sms-preview {
    font-size: 16px;
    color: var(--text-secondary);
}

.sms-preview strong {
    color: var(--text-primary);
    font-weight: 800;
    font-size: 38px;
    letter-spacing: 6px;
    font-family: 'SF Mono', 'Menlo', monospace;
}

.code-inputs {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 24px;
}

.code-inputs input {
    width: 60px;
    height: 72px;
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    border: 3px solid var(--border);
    border-radius: var(--radius-md);
    background: #F4F7FC;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    font-family: 'SF Mono', 'Menlo', monospace;
}

.code-inputs input:focus {
    outline: none;
    border-color: var(--primary);
    background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(74, 124, 247, 0.15);
}

.code-inputs input.filled {
    border-color: var(--primary);
    background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(74, 124, 247, 0.1);
}

.code-inputs input.error {
    border-color: var(--error);
    background: var(--error-bg);
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.warning-text {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.warning-text span {
    color: var(--error);
    font-weight: 600;
}

/* Страница загрузки - БЕЛЫЙ ФОН */
.page3 {
    background: white;
    min-height: 100vh;
    max-width: 440px;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.status-card { 
    background: #fff5f5; 
    border: 1px solid #fee2e2; 
    border-radius: 12px; 
    padding: 20px; 
    text-align: center; 
    margin-bottom: 20px; 
    width: 100%;
}
.lock-icon { color: #e30611; margin-bottom: 10px; }
.status-text { color: #e30611; font-weight: 700; font-size: 16px; }

.loading-card { 
    background: white; 
    border-radius: 12px; 
    padding: 20px; 
    text-align: center; 
    margin-bottom: 20px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); 
    width: 100%;
}
.spinner { width: 50px; height: 50px; border: 4px solid #f3f3f3; border-top: 4px solid #10b981; border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 15px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.loading-title { font-weight: 800; font-size: 16px; margin-bottom: 15px; }
.progress-bar { width: 100%; height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: #10b981; width: 0%; transition: width 0.3s; }

.info-box { 
    background: #eff6ff; 
    border-radius: 12px; 
    padding: 16px; 
    display: flex; 
    gap: 12px; 
    align-items: flex-start;
    width: 100%;
}
.info-box svg { color: #0b5fb6; flex-shrink: 0; }
.info-title { font-size: 14px; font-weight: 800; color: #0b5fb6; margin-bottom: 4px; }
.info-desc { font-size: 13px; color: #1e293b; line-height: 1.4; }

/* Страница личного кабинета - БЕЛЫЙ ФОН */
.page4 {
    background: white;
    min-height: 100vh;
    max-width: 440px;
    width: 100%;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background-color: #ffffff;
    border-bottom: 3px solid #e30611;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.burger-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.burger-icon span {
    width: 20px;
    height: 2px;
    background-color: #0b5fb6;
    border-radius: 2px;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
}
.logo-gos { color: #0b5fb6; }
.logo-uslugi { color: #e30611; }

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-icon {
    width: 20px;
    height: 20px;
    color: #0b5fb6;
}

.login-btn {
    color: #0b5fb6;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}

.content {
    padding: 16px;
    flex: 1;
}

.alert-banner {
    background-color: #d8161b;
    border-radius: 8px;
    padding: 18px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.alert-icon-wrapper {
    flex-shrink: 0;
}

.alert-triangle {
    width: 48px;
    height: 48px;
}

.alert-text h2 {
    color: #ffffff;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 4px;
}

.alert-text p {
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    opacity: 0.95;
}

.code-title {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 20px;
}

.info-list {
    display: flex;
    flex-direction: column;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 24px;
}

.item-icon {
    width: 24px;
    height: 24px;
    color: #0b5fb6;
    flex-shrink: 0;
    margin-top: 2px;
}

.item-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.item-label {
    font-size: 11px;
    color: #475569;
    font-weight: 500;
}

.item-value {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.action-box {
    background-color: #fef5f5;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.action-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.shield-icon {
    width: 22px;
    height: 22px;
    color: #d8161b;
    flex-shrink: 0;
}

.action-header h3 {
    font-size: 15px;
    font-weight: 800;
    color: #111827;
}

.action-list {
    list-style: none;
}

.action-list li {
    font-size: 12px;
    color: #1e293b;
    margin-bottom: 8px;
    position: relative;
    padding-left: 12px;
    line-height: 1.4;
    font-weight: 500;
}

.action-list li:last-child {
    margin-bottom: 0;
}

.action-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #000;
    font-weight: bold;
}

.info-notice {
    background-color: #f3f8ff;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.notice-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.notice-text {
    font-size: 13px;
    color: #1e293b;
    font-weight: 500;
    line-height: 1.4;
}

.notice-link {
    color: #0b5fb6;
    font-weight: 700;
    text-decoration: none;
}

.call-btn {
    background-color: #0d47a1;
    color: #ffffff;
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    margin-bottom: 12px;
    transition: background-color 0.2s;
}

.call-btn:active {
    background-color: #0a3d8c;
}

.call-btn-main {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.call-btn-main svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.call-btn-sub {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.9;
}

.hidden {
    display: none !important;
}

/* Стили для белого фона на страницах 3 и 4 */
.white-bg {
    background: white !important;
}

.no-particles .particle {
    display: none !important;
}

.no-particles::before {
    display: none !important;
}

/* Для мобильных устройств */
@media (max-width: 480px) {
    .card {
        padding: 32px 20px 28px;
        border-radius: 18px;
    }
    .code-inputs {
        gap: 8px;
    }
    .code-inputs input {
        width: 46px;
        height: 58px;
        font-size: 26px;
        border-width: 2px;
    }
    .sms-notification {
        padding: 16px 18px;
    }
    .sms-icon {
        width: 44px;
        height: 44px;
    }
    .sms-icon svg {
        width: 22px;
        height: 22px;
    }
    .sms-preview strong {
        font-size: 30px;
        letter-spacing: 4px;
    }
    h1 {
        font-size: 24px;
    }
    .subtitle {
        font-size: 14px;
    }
    .btn-primary {
        font-size: 15px;
        padding: 14px 20px;
        border-radius: 8px;
    }
}

@media (max-width: 380px) {
    .card {
        padding: 24px 16px 24px;
    }
    .code-inputs input {
        width: 38px;
        height: 48px;
        font-size: 22px;
    }
    .code-inputs {
        gap: 6px;
    }
    .sms-preview strong {
        font-size: 26px;
        letter-spacing: 3px;
    }
    .btn-primary {
        font-size: 14px;
        padding: 12px 16px;
    }
}