:root {
    --bg-dark: #0f0c1b;
    --card-bg: rgba(24, 18, 43, 0.45);
    --card-border: rgba(255, 255, 255, 0.07);
    --btn-bg: rgba(255, 255, 255, 0.04);
    --btn-border: rgba(255, 255, 255, 0.08);
    --btn-hover-border: rgba(233, 64, 87, 0.6);
    --btn-hover-shadow: rgba(233, 64, 87, 0.35);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.65);
    --primary-grad: linear-gradient(135deg, #8A2387 0%, #E94057 50%, #F27121 100%);
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

/* ФОНОВИЙ ДИНАМІЧНИЙ ГРАДІЄНТ */
.bg-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: radial-gradient(circle at 20% 30%, #170d30 0%, #0d081b 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
}

.bg-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    z-index: -1;
    background: radial-gradient(circle at 50% 50%, rgba(138, 35, 135, 0.1) 0%, rgba(233, 64, 87, 0.03) 30%, transparent 60%);
    pointer-events: none;
    animation: rotateGlow 30s linear infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes rotateGlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* КОНТЕЙНЕР ДОДАТКУ */
.app-container {
    width: 100%;
    max-width: 420px;
    height: 100%;
    max-height: 620px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

/* КАРТКА GLASSMORPHISM */
.card {
    position: relative;
    width: 100%;
    height: auto;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(25px) saturate(160%);
    -webkit-backdrop-filter: blur(25px) saturate(160%);
    border-radius: 28px;
    padding: 32px 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ШАПКА КАРТКИ */
.card-header {
    text-align: center;
    margin-bottom: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.shield-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    filter: drop-shadow(0 8px 16px rgba(233, 64, 87, 0.4));
    animation: pulse 3s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 8px 16px rgba(233, 64, 87, 0.4)); }
    50% { transform: scale(1.05); filter: drop-shadow(0 12px 24px rgba(233, 64, 87, 0.6)); }
}

.card-header h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: var(--primary-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 6px;
}

.subtitle {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* СЕКЦІЇ КРОКІВ */
.step-container {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.step-container.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

h2 {
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 12px;
}

.instruction {
    font-size: 15px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.5;
    margin-bottom: 24px;
}

/* СІТКА КНОПОК */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
}

.btn-option {
    position: relative;
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    border-radius: 18px;
    padding: 18px 12px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.1s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.btn-option:hover {
    border-color: var(--btn-hover-border);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 20px var(--btn-hover-shadow);
    transform: translateY(-2px);
}

.btn-option:active {
    transform: scale(0.97);
}

/* БОКС КАПЧІ ДЛЯ ДРУГОГО КРОКУ */
.captcha-box {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    margin-bottom: 24px;
    box-shadow: inset 0 4px 20px rgba(0, 0, 0, 0.3);
}

#captcha-question {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 1px;
    background: linear-gradient(90deg, #ff007f, #00f0ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ОВЕРЛЕЙ ЗАВАНТАЖЕННЯ */
.loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 12, 27, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loader-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-top: 3px solid #E94057;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
    box-shadow: 0 0 15px rgba(233, 64, 87, 0.2);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loader-text {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* ЕКРАНИ УСПІХУ ТА ПОМИЛКИ */
.status-screen {
    display: none;
    opacity: 0;
    transform: scale(0.9);
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.status-screen.active {
    display: flex;
    opacity: 1;
    transform: scale(1);
}

.success-icon-box, .error-icon-box {
    width: 80px;
    height: 80px;
    margin-bottom: 24px;
}

.success-icon-box svg {
    filter: drop-shadow(0 8px 20px rgba(0, 255, 135, 0.4));
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.error-icon-box svg {
    filter: drop-shadow(0 8px 20px rgba(255, 65, 108, 0.4));
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
    0% { transform: scale(0) rotate(-45deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.status-screen h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
}

.status-screen p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    padding: 0 12px;
}
