:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #38bdf8;
    --accent-hover: #0ea5e9;
    --success-color: #22c55e;
    --error-color: #ef4444;
    --border-color: rgba(148, 163, 184, 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(56, 189, 248, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 20%);
}

.app-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px 32px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-card.hidden {
    display: none;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.card-header {
    margin-bottom: 32px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.qr-section {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.qr-container {
    position: relative;
    width: 240px;
    height: 240px;
    background: white;
    padding: 16px;
    border-radius: 16px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.qr-code {
    width: 100%;
    height: 100%;
    display: block;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Overlays */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.loading-overlay {
    background: rgba(255, 255, 255, 0.9);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(56, 189, 248, 0.2);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 0.8s linear infinite;
}

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

.success-overlay {
    background: rgba(255, 255, 255, 0.98);
}

.checkmark-circle {
    width: 56px;
    height: 56px;
    background: var(--success-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.checkmark {
    width: 16px;
    height: 28px;
    border-bottom: 4px solid white;
    border-right: 4px solid white;
    transform: rotate(45deg) translate(-2px, -2px);
}

@keyframes popIn {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

.expired-overlay {
    background: rgba(255, 255, 255, 0.95);
    color: #1e293b;
}

.refresh-icon {
    font-size: 32px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.btn-text {
    background: none;
    border: none;
    color: var(--accent-color);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    margin-top: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-text:hover {
    background: rgba(56, 189, 248, 0.1);
}

.status-message {
    height: 24px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    transition: color 0.3s;
}

.status-message.error {
    color: var(--error-color);
}

/* Download Section */
.download-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.download-section p {
    margin-bottom: 16px;
    font-size: 13px;
}

.store-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.store-btn {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    text-decoration: none;
    color: white;
    transition: all 0.2s;
}

.store-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.store-icon {
    font-size: 20px;
    margin-right: 8px;
}

.store-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
}

.small-text {
    font-size: 9px;
    opacity: 0.8;
}

.big-text {
    font-size: 13px;
    font-weight: 600;
}

/* Returning User Styles */
.user-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 32px;
}

.avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent-color), #8b5cf6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: white;
    margin-bottom: 16px;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.1);
}

.username {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.user-email {
    font-size: 14px;
    color: var(--text-secondary);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--accent-color);
    color: #0f172a;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 16px;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.divider-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.btn-secondary {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-secondary:hover {
    color: var(--text-primary);
}

/* Simulation Controls */
.sim-controls {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: #1e293b;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    width: 240px;
}

.sim-controls h3 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.sim-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sim-btn {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13px;
    text-align: left;
    transition: all 0.2s;
}

.sim-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(2px);
}

.sim-btn.success {
    border-left: 3px solid var(--success-color);
}

.sim-btn.danger {
    border-left: 3px solid var(--error-color);
}

.sim-btn.warning {
    border-left: 3px solid #f59e0b;
}

.sim-btn.info {
    border-left: 3px solid #8b5cf6;
}