:root {
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text: #ffffff;
    --hint: rgba(255, 255, 255, 0.7);
    --btn: #ffffff;
    --btn-text: #764ba2;
    --secondary-bg: rgba(255, 255, 255, 0.15);
    --destructive: #ff4b4b;
    --input-bg: rgba(255, 255, 255, 0.1);
}

* {
    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 4px 8px rgba(0,0,0,0.2));
}

@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 4px rgba(0,0,0,0.2);
}

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

.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, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.2);
}

.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 12px rgba(0,0,0,0.2);
}

.btn-primary:active {
    transform: scale(0.98);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.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 {
    width: 100%;
    padding: 20px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 3px;
    text-align: center;
    background: rgba(255,255,255,0.9);
    color: #764ba2;
    border-radius: 16px;
    font-family: "SF Mono", Menlo, monospace;
    user-select: all;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.loader {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    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.3);
    border-top-color: #ffffff;
    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, 75, 75, 0.9);
    color: #fff;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    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; }
}
