:root {
    --primary-color: #328fde;
    --primary-hover: #2a7ac0;
    --text-color: #1f2937;
    --text-secondary: #6b7280;
    --bg-color: #f3f4f6;
    --error-color: #ef4444;
    --success-color: #10b981;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --font-family: 'Inter', sans-serif;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition-speed: 0.3s;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

/* Background Elements */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: #bfdbfe;
    /* Light Blue */
    animation: float 20s infinite ease-in-out;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: #e9d5ff;
    /* Light Purple */
    animation: float 25s infinite ease-in-out reverse;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(50px, 50px);
    }

    100% {
        transform: translate(0, 0);
    }
}

/* Main Container */
.main-container {
    width: 100%;
    max-width: 440px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 10px;
}

.logo {
    height: 40px;
}

/* Views */
.view {
    width: 100%;
    transition: opacity var(--transition-speed) ease;
}

/* Cards (Glassmorphism) */
.card.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px 32px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform var(--transition-speed) ease;
}

/* Text Styles */
h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-color);
}

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

/* Profile Preview */
.profile-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.5);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 0, 0, 0.05);
    width: 100%;
    margin-bottom: 32px;
}

.avatar {
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
}

.profile-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.profile-info .name {
    font-weight: 600;
    font-size: 16px;
}

.profile-info .pacer-id {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Forms & Inputs */
.input-group {
    width: 100%;
    text-align: left;
    margin-bottom: 24px;
}

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

input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid #e5e7eb;
    font-size: 16px;
    background: white;
    transition: all 0.2s;
    outline: none;
}

input[type="text"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(50, 143, 222, 0.15);
}

.error-msg {
    display: block;
    color: var(--error-color);
    font-size: 13px;
    margin-top: 6px;
    min-height: 20px;
}

/* Code Input */
.code-input-container {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 12px;
}

.code-digit {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    padding: 0;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 14px;
    border-radius: 50px;
    /* Pill shape */
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px rgba(50, 143, 222, 0.25);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(50, 143, 222, 0.3);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-text {
    background: transparent;
    color: var(--primary-color);
    font-weight: 500;
    margin-top: 12px;
    font-size: 14px;
}

.btn-text:hover {
    background: rgba(50, 143, 222, 0.05);
}

.secondary-actions {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 4px;
    margin-top: 16px;
}

.secondary-actions .btn-text {
    margin: 0;
}

/* Success View */
.success-card {
    padding: 60px 40px;
}

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

.success-icon svg {
    width: 40px;
    height: 40px;
}

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

    100% {
        transform: scale(1);
    }
}

/* Loader */
.loader {
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-top: 16px;
}

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

/* Utilities */
.hidden {
    display: none !important;
}

/* Toast */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(31, 41, 55, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    opacity: 0;
    animation: slideDown 3s forwards;
    /* Quick dirty animation for prototype */
}

@keyframes slideDown {
    0% {
        transform: translate(-50%, -20px);
        opacity: 0;
    }

    10% {
        transform: translate(-50%, 0);
        opacity: 1;
    }

    90% {
        transform: translate(-50%, 0);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -20px);
        opacity: 0;
    }
}

/* Shake Animation */
.shake {
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .main-container {
        padding: 16px;
    }

    .card.glass-card {
        padding: 32px 24px;
    }
}