:root {
    /* Основной фон: Глубокий темный, почти черный с легким оттенком бургундского/вишневого */
    --bg-gradient: linear-gradient(135deg, #050505 0%, #1a0508 50%, #1f0814 100%);
    /* Цвет текста - слегка теплый белый, чтобы не резал глаза на черном */
    --text: #ffeef5;
    --hint: rgba(255, 238, 245, 0.5);
    /* Кнопки: Неоновый красно-розовый, как вывеска в ночном клубе */
    --btn: #ff2d6f;
    --btn-text: #ffffff;
    --secondary-bg: rgba(255, 255, 255, 0.05);
    --destructive: #ff4b4b;
    /* Поля ввода - полупрозрачный темный дым */
    --input-bg: rgba(255, 255, 255, 0.05);
    /* Цвет самого "Купона/Ключа" доступа на финальном экране */
    --key-accent: #ff2d6f;
}

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

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    background: var(--bg-gradient);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
}

.logo {
    font-size: 64px;
    margin-bottom: 16px;
    /* Легкое свечение для логотипа, чтобы он светился в темноте */
    animation: bounce 2s infinite;
    filter: drop-shadow(0 0 12px rgba(255, 45, 111, 0.6));
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.screen {
    width: 100%;
    max-width: 360px;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    animation: fadeIn 0.4s ease;
}

.screen.active { display: flex; }

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

.title {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 8px;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.subtitle {
    font-size: 15px;
    color: var(--hint);
    margin: 0 0 24px;
    text-align: center;
    min-height: 20px;
    line-height: 1.4;
}

.input {
    width: 100%;
    padding: 16px;
    font-size: 18px;
    font-weight: 500;
    text-align: center;
    letter-spacing: 2px;
    background: var(--input-bg);
    color: var(--text);
    border: 2px solid transparent;
    border-radius: 16px;
    outline: none;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}

.input::placeholder {
    color: var(--hint);
    letter-spacing: normal;
}

.input:focus {
    /* При клике на ввод - тонкая неоновая обводка */
    border-color: rgba(255, 45, 111, 0.5);
    background: rgba(255, 45, 111, 0.05);
}

.input.error {
    border-color: var(--destructive);
    animation: shake 0.4s;
}

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

.hint {
    font-size: 13px;
    color: var(--hint);
    text-align: center;
    margin: 0;
}

.btn {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: var(--btn);
    color: var(--btn-text);
    /* Яркая неоновая тень под кнопкой */
    box-shadow: 0 4px 20px rgba(255, 45, 111, 0.4);
}

.btn-primary:active {
    transform: scale(0.98);
    box-shadow: 0 2px 10px rgba(255, 45, 111, 0.3);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-link {
    background: transparent;
    color: var(--text);
    padding: 12px;
    opacity: 0.7;
}

.btn-link:active { opacity: 1; }

/* Это блок с самим ключом (бывший coupon) */
.coupon {
    width: 100%;
    padding: 20px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 3px;
    text-align: center;
    /* Делаем его темным, чтобы он выглядел как терминал, а не как яркий купон */
    background: rgba(0, 0, 0, 0.6);
    color: var(--key-accent);
    border: 1px solid rgba(255, 45, 111, 0.3);
    border-radius: 16px;
    font-family: "SF Mono", Menlo, monospace;
    user-select: all;
    /* Свечение текста */
    text-shadow: 0 0 8px rgba(255, 45, 111, 0.4);
}

.loader {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.loader.hidden { display: none; }

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    /* Спиннер тоже красим в клубный неон */
    border-top-color: var(--btn);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 45, 111, 0.95);
    color: #fff;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    z-index: 200;
    animation: slideUp 0.3s ease;
    max-width: 90%;
    text-align: center;
    backdrop-filter: blur(4px);
}

.toast.hidden { display: none; }

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