/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-primary: #111111;
    --color-secondary: #888888;
    --color-accent: #222222;
    --color-background: #9FABB5;
    --color-surface: #ffffff;
    --color-success: #16a34a;
    --color-border: #e5e5e5;
    --color-button: #3D4799;
    --color-button-hover: #2D3589;
    --font-family: 'Sora', system-ui, -apple-system, sans-serif;
    --border-radius: 8px;
    --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.08);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: var(--font-family);
    background: var(--color-background);
    color: var(--color-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-feature-settings: "kern" 1, "liga" 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    background-image: 
        radial-gradient(circle at 25% 25%, #000 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, #000 1px, transparent 1px);
    background-size: 24px 24px;
    background-position: 0 0, 12px 12px;
    pointer-events: none;
}

/* Layout */
.container {
    width: 100%;
    max-width: 420px;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.content {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 3rem 2.5rem;
    text-align: center;
    box-shadow: var(--shadow-medium);
    position: relative;
    overflow: hidden;
}

.content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-border), transparent);
}

/* Logo */
.logo {
    display: inline-flex;
    margin-bottom: 2rem;
    color: var(--color-primary);
}

.logo img {
    max-width: 120px;
    height: auto;
    object-fit: contain;
}

/* Typography */
h1 {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
    line-height: 1.3;
}

.subtitle {
    color: var(--color-secondary);
    font-size: 0.875rem;
    margin-bottom: 2.5rem;
    line-height: 1.5;
    font-weight: 400;
}

/* Form */
.form-container {
    display: block;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-family: inherit;
    background: var(--color-surface);
    transition: var(--transition);
    outline: none;
}

input::placeholder {
    color: var(--color-secondary);
}

input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

input:invalid:not(:placeholder-shown) {
    border-color: #dc2626;
}

button {
    width: 100%;
    background: var(--color-button);
    color: white;
    border: none;
    padding: 0.875rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

button:hover {
    background: var(--color-button-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    display: none;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.privacy-note {
    font-size: 0.75rem;
    color: var(--color-secondary);
    margin: 0;
    text-align: center;
}

/* Success Message */
.success-message {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.success-message.show {
    display: block;
}

.success-icon {
    display: inline-flex;
    width: 48px;
    height: 48px;
    background: var(--color-success);
    color: white;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.success-message h2 {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.success-message p {
    color: var(--color-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
}

/* Decorative Elements */
.decorative-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.dot {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--color-border);
    border-radius: 50%;
}

.dot-1 {
    top: 20%;
    left: 10%;
    animation: float 6s ease-in-out infinite;
}

.dot-2 {
    top: 60%;
    right: 15%;
    animation: float 8s ease-in-out infinite reverse;
}

.dot-3 {
    bottom: 30%;
    left: 20%;
    animation: float 7s ease-in-out infinite;
}

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

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

/* Loading State */
.loading .btn-text {
    display: none;
}

.loading .btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }
    
    .content {
        padding: 2rem 1.5rem;
        border-radius: 12px;
    }
    
    h1 {
        font-size: 1.375rem;
    }
    
    .subtitle {
        font-size: 0.8125rem;
        margin-bottom: 2rem;
    }
    
    .logo {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 360px) {
    .container {
        padding: 0.75rem;
    }
    
    .content {
        padding: 1.5rem 1.25rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --color-primary: #ffffff;
        --color-secondary: #a1a1aa;
        --color-accent: #f4f4f5;
        --color-background: #0a0a0a;
        --color-surface: #111111;
        --color-border: #27272a;
    }
    
    .grain-overlay {
        background-image: 
            radial-gradient(circle at 25% 25%, #fff 1px, transparent 1px),
            radial-gradient(circle at 75% 75%, #fff 1px, transparent 1px);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}