:root {
    --terminal-green: #00ff00;
    --terminal-dim-green: #00aa00;
    --bg-color: #f2f4f7;
    --gs-blue: #0d4cd3;
    --gs-blue-hover: #0b3faf;
    --gs-blue-light: #e8eeff;
    --gs-border: #d3d8e6;
    --gs-text: #20262d;
    --gs-text-muted: #5e6b7d;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    background-color: var(--bg-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow-x: hidden;
    overflow-y: auto;
}

/* ===== ГОСУСЛУГИ СТИЛЬ ===== */

/* Верхняя синяя шапка */
.gs-topbar {
    width: 100%;
    background: var(--gs-blue);
    padding: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
    flex-shrink: 0;
    min-height: 56px;
}

.gs-topbar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 20px;
}

.gs-topbar-emblem {
    width: 44px;
    height: 44px;
    border-radius: 0;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
    mix-blend-mode: multiply;
}

.gs-topbar-name {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

/* Синяя полоска под шапкой */
.gs-subbar {
    width: 100%;
    background: #1a56db;
    height: 4px;
}

/* Registry Page Styles */
.registry-page {
    width: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--bg-color);
    box-sizing: border-box;
}

.registry-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 16px 60px;
    width: 100%;
    box-sizing: border-box;
    flex: 1;
}

.registry-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 0;
}

.star-icon {
    display: none; /* скрываем старую иконку */
}

.registry-header h1 {
    color: var(--gs-text);
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 6px;
    letter-spacing: -0.3px;
}

.registry-subtitle {
    font-size: 14px;
    color: var(--gs-text-muted);
    margin: 0 0 28px;
    text-align: center;
}

.registry-card {
    background-color: #ffffff;
    border: 1px solid var(--gs-border);
    border-radius: 8px;
    padding: 36px 32px 32px;
    width: 100%;
    max-width: 520px;
    text-align: left;
    box-shadow: 0 2px 12px rgba(13,76,211,0.07);
    box-sizing: border-box;
    position: relative;
}

/* Синяя полоска сверху карточки */
.registry-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gs-blue);
    border-radius: 8px 8px 0 0;
}

.registry-desc {
    color: var(--gs-text);
    font-size: 15px;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 16px;
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--gs-text-muted);
    margin-bottom: 6px;
}

.input-group input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #b0bec5;
    border-radius: 4px;
    font-size: 16px;
    color: var(--gs-text);
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.input-group input::placeholder {
    color: #aab0bb;
}

.input-group input:focus {
    outline: none;
    border-color: var(--gs-blue);
    box-shadow: 0 0 0 3px rgba(13,76,211,0.12);
}

.registry-btn {
    background-color: var(--gs-blue);
    border: none;
    border-radius: 4px;
    padding: 14px 20px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.18s, box-shadow 0.18s;
    font-family: inherit;
    letter-spacing: 0.01em;
}

.registry-btn:hover {
    background-color: var(--gs-blue-hover);
    box-shadow: 0 2px 10px rgba(13,76,211,0.25);
}

.registry-btn:active {
    background-color: #0a3090;
    box-shadow: none;
}

/* Нижний текст под карточкой */
.registry-footer-note {
    margin-top: 20px;
    font-size: 13px;
    color: var(--gs-text-muted);
    text-align: center;
    max-width: 520px;
    line-height: 1.5;
}

.registry-footer-note a {
    color: var(--gs-blue);
    text-decoration: none;
}

.registry-footer-note a:hover {
    text-decoration: underline;
}

/* Terminal Screen Styles */
.terminal-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000000;
    z-index: 1000;
    display: none;
    color: var(--terminal-green);
    font-family: 'Consolas', 'Courier New', 'Monaco', monospace;
}

.crt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0,0,0,0) 60%, rgba(0,0,0,0.15) 100%);
    pointer-events: none;
    z-index: 100;
}

.terminal {
    padding: 10px;
    height: 100%;
    box-sizing: border-box;
    font-size: 14px;
    line-height: 1.3;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-y: auto;
    position: relative;
    z-index: 10;
}

#output {
    display: inline;
}

.cursor {
    display: inline-block;
    width: 8px;
    height: 14px;
    background-color: var(--terminal-green);
    vertical-align: bottom;
    animation: blink 1s step-end infinite;
}

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

.log-prefix {
    color: var(--terminal-dim-green);
}

.success-text {
    color: var(--terminal-green);
}

.done-text {
    color: var(--terminal-green);
    font-weight: bold;
}

.progress-bar {
    color: var(--terminal-green);
}

/* Alert Screen Styles — Госуслуги стиль */
.alert-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #f2f4f7;
    z-index: 2000;
    display: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.gs-page-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 16px 60px;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Карточка предупреждения */
.gs-alert-card {
    background: #ffffff;
    border: 1px solid #d3d8e6;
    border-radius: 8px;
    padding: 40px 36px 36px;
    width: 100%;
    box-shadow: 0 2px 12px rgba(13,76,211,0.07);
    text-align: center;
    position: relative;
    box-sizing: border-box;
    animation: gsCardAppear 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.gs-alert-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #dc2626;
    border-radius: 8px 8px 0 0;
}

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

.gs-alert-icon-wrap {
    width: 64px;
    height: 64px;
    background: #fef2f2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    border: 1.5px solid #fca5a5;
}

.gs-alert-icon-wrap svg {
    width: 32px;
    height: 32px;
    color: #dc2626;
    animation: pulseAlert 2s infinite;
}

@keyframes pulseAlert {
    0%   { transform: scale(1);    opacity: 1; }
    50%  { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1);    opacity: 1; }
}

.gs-alert-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fef2f2;
    color: #dc2626;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px 12px;
    border-radius: 4px;
    border: 1px solid #fca5a5;
    margin-bottom: 16px;
}

.gs-alert-title {
    color: #111827;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 20px;
    line-height: 1.3;
    letter-spacing: -0.3px;
}

.gs-alert-body {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 20px 24px;
    font-size: 16px;
    color: #20262d;
    font-weight: 500;
    line-height: 1.6;
}

@media (max-width: 640px) {
    .gs-alert-card {
        padding: 32px 20px 28px;
    }
    .gs-alert-title {
        font-size: 19px;
    }
}

/* ===== МОДАЛЬНОЕ ОКНО 6-ЗНАЧНОГО КОДА ===== */
.code-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
    box-sizing: border-box;
}

.code-modal-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 36px 32px 32px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    text-align: center;
    position: relative;
    box-sizing: border-box;
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.code-modal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--gs-blue);
    border-radius: 12px 12px 0 0;
}

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

.code-modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.code-modal-header img {
    width: 48px;
    height: 48px;
}

.code-modal-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--gs-text);
    margin: 0 0 8px;
}

.code-modal-subtitle {
    font-size: 14px;
    color: var(--gs-text-muted);
    line-height: 1.5;
    margin: 0 0 28px;
}

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

.code-digit-input {
    width: 48px;
    height: 56px;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    border: 2px solid #b0bec5;
    border-radius: 8px;
    background: #f8fafc;
    color: var(--gs-text);
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
    pointer-events: none;
    user-select: none;
    caret-color: transparent;
}

.code-digit-input:focus {
    border-color: var(--gs-blue);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(13, 76, 211, 0.15);
}

.code-digit-input.filled {
    border-color: var(--gs-blue);
    background: #ffffff;
}

.code-timer {
    font-size: 13px;
    color: var(--gs-text-muted);
    margin-bottom: 24px;
}

.code-resend-btn {
    background: none;
    border: none;
    color: var(--gs-blue);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    font-size: 13px;
    display: none;
    margin-bottom: 24px;
}

.code-submit-btn {
    background-color: var(--gs-blue);
    border: none;
    border-radius: 6px;
    padding: 14px 20px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.18s, box-shadow 0.18s;
    letter-spacing: 0.01em;
}

.code-submit-btn:hover {
    background-color: var(--gs-blue-hover);
    box-shadow: 0 4px 12px rgba(13, 76, 211, 0.3);
}

.code-submit-btn:disabled {
    background-color: #a0aec0;
    cursor: not-allowed;
    box-shadow: none;
}

.code-footer-note {
    margin-top: 20px;
    font-size: 12px;
    color: var(--gs-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Мобильная адаптация */
@media (max-width: 480px) {
    .code-modal-overlay {
        padding: 12px;
    }

    .code-modal-card {
        padding: 28px 18px 24px;
        border-radius: 10px;
    }

    .code-modal-title {
        font-size: 19px;
    }

    .code-modal-subtitle {
        font-size: 13px;
        margin-bottom: 20px;
    }

    .code-inputs-container {
        gap: 6px;
        margin-bottom: 20px;
    }

    .code-digit-input {
        width: 40px;
        height: 50px;
        font-size: 20px;
        border-radius: 6px;
    }

    .registry-card {
        padding: 24px 20px 24px;
    }

    .registry-header h1 {
        font-size: 24px;
    }
}

@media (max-width: 360px) {
    .code-inputs-container {
        gap: 4px;
    }

    .code-digit-input {
        width: 36px;
        height: 46px;
        font-size: 18px;
    }
}
