/* ==========================================================================
   Base CSS - Shared Design System
   ========================================================================== */

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

/* CSS Custom Properties */
:root {
    --bg: #fafafa;
    --surface: #ffffff;
    --border: rgba(0,0,0,0.06);
    --text: #1d1d1f;
    --text-secondary: #86868b;
    --text-tertiary: #adadad;
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --accent-soft: rgba(0,113,227,0.08);
    --radius: 12px;
    --radius-sm: 8px;
    --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
}

/* Typography Base */
html, body {
    height: 100%;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

html {
    scroll-behavior: smooth;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    background: var(--text);
    color: white;
    border: none;
    border-radius: 980px;
    font-size: 17px;
    font-weight: 400;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.btn-primary:hover {
    background: #333;
    transform: scale(1.02);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.btn-primary:hover svg {
    transform: translateX(4px);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    background: transparent;
    color: var(--accent);
    border: none;
    border-radius: 980px;
    font-size: 17px;
    font-weight: 400;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    text-decoration: none;
    letter-spacing: -0.01em;
}

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

/* ==========================================================================
   Modal Base
   ========================================================================== */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 24px;
}

.modal.active {
    display: flex;
}

.modal-container {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 32px;
    width: 100%;
    max-width: 400px;
    position: relative;
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(0,0,0,0.08);
    color: var(--text);
}

.modal-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
    text-align: center;
    letter-spacing: -0.3px;
}

.modal-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    text-align: center;
}

/* ==========================================================================
   Auth Components
   ========================================================================== */

.auth-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
    text-align: center;
    letter-spacing: -0.3px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    text-align: center;
}

/* OAuth Buttons */
.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    font-family: var(--font);
}

.oauth-btn-google {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}

.oauth-btn-google:hover {
    background: var(--bg);
    border-color: var(--text-secondary);
}

.oauth-btn-apple {
    background: var(--text);
    border: none;
    color: white;
}

.oauth-btn-apple:hover {
    background: #333;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--text-tertiary);
    font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Auth Form */
.auth-form .form-group {
    margin-bottom: 16px;
}

.auth-form label,
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.auth-form input,
.form-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    font-family: var(--font);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    transition: all 0.2s;
}

.auth-form input:focus,
.form-input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface);
}

.auth-form input::placeholder,
.form-input::placeholder {
    color: var(--text-tertiary);
}

.auth-submit {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-family: var(--font);
    font-weight: 500;
    transition: background 0.2s;
}

.auth-submit:hover {
    background: var(--accent-hover);
}

.auth-error {
    color: #ff3b30;
    font-size: 13px;
    margin-top: 12px;
    text-align: center;
}

/* OTP Section */
.otp-section {
    display: none;
}

.otp-section.active {
    display: block;
}

.otp-input {
    text-align: center;
    letter-spacing: 6px;
    font-size: 18px;
    font-weight: 600;
}

.otp-message {
    text-align: center;
    margin-bottom: 16px;
    color: var(--text-secondary);
    font-size: 14px;
}

.otp-message span {
    font-weight: 600;
    color: var(--text);
}

.resend-link {
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.resend-link button {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
}

.resend-link button:hover {
    text-decoration: underline;
}

.back-link {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font);
    font-size: 13px;
    text-align: center;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--text);
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */

.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
}

.toast {
    background: var(--text);
    color: white;
    padding: 12px 20px;
    border-radius: 100px;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: toast-in 0.3s ease;
}

.toast.error {
    background: #ff3b30;
}

.toast.success {
    background: #34c759;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .modal-container {
        padding: 24px;
    }
}
