/* Unified Auth Styles for godspeed - Login and Authentication Pages */

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

:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --error: #e53e3e;
    --success: #38a169;
    --text: #2d3748;
    --text-light: #718096;
    --bg: #f7fafc;
    --white: #ffffff;
    --border: #e2e8f0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.6;
}

.container {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 460px;
    overflow: hidden;
    animation: slideUp 0.4s ease-out;
}

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

.header {
    text-align: center;
    padding: 40px 40px 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-bottom: 1px solid var(--border);
}

.logo h1 {
    font-size: 36px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -1px;
}

.logo p {
    color: var(--text-light);
    font-size: 14px;
    margin-top: 8px;
}

.content {
    padding: 16px 40px 40px;
}

.section-header {
    margin-bottom: 24px;
}

.section-title {
    text-align: center;
    color: var(--text);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

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

input[type="email"],
input[type="password"],
input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
    background: var(--white);
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input:disabled {
    background: var(--bg);
    cursor: not-allowed;
    opacity: 0.6;
}

.submit-button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
}

.submit-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.submit-button:active:not(:disabled) {
    transform: translateY(0);
}

.submit-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Secondary button style for waitlist */
.submit-button.secondary {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--border);
    padding: 12px;
}

.submit-button.secondary:hover:not(:disabled) {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.divider {
    position: relative;
    text-align: center;
    margin: 28px 0;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
}

.divider span {
    position: relative;
    padding: 0 16px;
    background: var(--white);
    color: var(--text-light);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.waitlist-section .section-title {
    font-size: 16px;
    color: var(--text);
}

.waitlist-section .section-subtitle {
    color: var(--text-light);
    font-size: 13px;
}

.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    animation: slideDown 0.3s ease-out;
}

.message.error, .error-message {
    background: #fed7d7;
    color: var(--error);
    border: 1px solid #fc8181;
}

.message.success, .success-message {
    background: #c6f6d5;
    color: var(--success);
    border: 1px solid #9ae6b4;
}

/* Subtle success message with smooth fade transition */
.message.success-subtle {
    background: #c6f6d5;
    color: var(--success);
    border: 1px solid #9ae6b4;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    animation: gentleFadeIn 0.3s ease-out forwards;
}

.message.success-subtle .success-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.message.success-subtle .success-icon svg {
    width: 100%;
    height: 100%;
    stroke: var(--success);
    stroke-width: 2.5;
}

@keyframes gentleFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade out animation for smooth transitions */
.message.fade-out {
    animation: fadeOut 0.2s ease-out forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.message.info {
    background: #bee3f8;
    color: #2c5282;
    border: 1px solid #90cdf4;
}

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

/* Progress bar for form submissions */
.progress-bar {
    margin-top: 12px;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    display: none;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-bar.active {
    display: block;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 3px;
    transition: width 0.3s ease-out;
    width: 0%;
    will-change: width;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-fill.complete {
    animation: pulse 0.5s ease;
}

@keyframes pulse {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(1.1); }
}

.hidden {
    display: none !important;
}

.show {
    display: block !important;
}


/* Features list */
.features {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* Features at top of page - no top border or padding */
.features.features-top {
    margin-top: 0;
    padding-top: 0;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-top: none;
    border-bottom: 1px solid var(--border);
}

.feature-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--text-light);
}

.feature-icon {
    width: 16px;
    height: 16px;
    margin-right: 10px;
    margin-top: 2px;
    flex-shrink: 0;
    color: var(--primary);
}

.footer-links {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 14px;
    color: var(--text-light);
}

.footer-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* Tab navigation */
.tabs {
    display: flex;
    gap: 0;
    margin-top: 24px;
    background: var(--bg);
    border-radius: 8px;
    padding: 4px;
}

.tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s;
    font-size: 14px;
}

.tab:hover:not(.active) {
    color: var(--text);
}

.tab.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

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

.auth-form.hidden {
    display: none;
}

/* Checkbox group */
.checkbox-group {
    display: flex;
    align-items: center;
    margin: 16px 0;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.checkbox-group label {
    margin: 0;
    font-weight: normal;
    font-size: 14px;
    color: var(--text-light);
}

/* Link button */
.link-button {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    padding: 0;
    font-weight: 500;
}

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

/* Form helper text */
.form-helper-text {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 14px;
    color: var(--text-light);
}

.form-helper-text .link-button {
    font-size: 14px;
}

/* Invite code input */
.invite-input-wrapper {
    position: relative;
}

.invite-badge {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--success);
    color: var(--white);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* Password reset form */
#resetPasswordForm {
    display: none;
}

#resetPasswordForm.show {
    display: block;
}

/* Password toggle styles */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input[type="password"],
.password-input-wrapper input[type="text"] {
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background var(--transition-fast);
    padding: 0;
}

.password-toggle:hover {
    background: var(--bg);
}

.password-toggle:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.password-toggle svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-light);
    transition: stroke var(--transition-fast);
}

.password-toggle:hover svg {
    stroke: var(--text);
}

/* Initial visibility states for password toggle */
.eye-icon {
    display: none;
}

.eye-off-icon {
    display: block;
}

/* Form info messages */
.form-info {
    padding: 10px 12px;
    background: var(--bg);
    border-radius: 6px;
    border: 1px solid var(--border);
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* OTP form */
#otpForm {
    display: none;
}

#otpForm.show {
    display: block;
}

.otp-info {
    background: var(--bg);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-light);
}

@media (max-width: 480px) {
    .container {
        max-width: 100%;
    }

    .header, .content {
        padding-left: 24px;
        padding-right: 24px;
    }

    .logo h1 {
        font-size: 32px;
    }
}

/* Password Reset Mode Styles */
.container.password-reset-mode {
    border: 2px solid var(--primary);
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.2);
    animation: pulseGlow 2s ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 20px 60px rgba(102, 126, 234, 0.2);
    }
    50% {
        box-shadow: 0 20px 60px rgba(102, 126, 234, 0.35);
    }
}

/* Reset context banner */
.reset-context-banner {
    text-align: center;
    padding: 24px 20px;
    margin: -16px -40px 24px -40px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-bottom: 1px solid var(--border);
}

.reset-context-banner .shield-icon {
    color: var(--primary);
    margin-bottom: 8px;
}

/* Password requirements */
.password-requirements {
    background: var(--bg);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.requirement-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    color: var(--text-light);
    font-size: 14px;
}

.requirement-item:last-child {
    margin-bottom: 0;
}

.requirement-item svg {
    color: var(--success);
    flex-shrink: 0;
}

/* Password strength meter */
.password-strength-meter {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.strength-bar-container {
    flex: 1;
    height: 6px;
    background: var(--bg);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.strength-bar {
    height: 100%;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 2px;
}

.strength-bar[data-strength="weak"] {
    width: 33%;
    background-color: var(--error);
}

.strength-bar[data-strength="medium"] {
    width: 66%;
    background-color: #f6ad55;
}

.strength-bar[data-strength="strong"] {
    width: 100%;
    background-color: var(--success);
}

.strength-text {
    font-size: 13px;
    font-weight: 500;
    min-width: 50px;
    color: var(--text-light);
}

/* Security notice */
.security-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(237, 137, 54, 0.1);
    border: 1px solid rgba(237, 137, 54, 0.2);
    border-radius: 6px;
    margin-bottom: 20px;
    color: #c05621;
    font-size: 13px;
}

.security-notice svg {
    flex-shrink: 0;
    color: #ed8936;
}

/* Success overlay */
.success-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 100;
    border-radius: 12px;
}

.success-overlay.visible {
    opacity: 1;
}

.success-content {
    text-align: center;
    padding: 40px;
}

.success-content .checkmark {
    color: var(--success);
    margin-bottom: 16px;
    animation: checkmarkScale 0.5s ease-out;
}

@keyframes checkmarkScale {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.success-content h3 {
    color: var(--text);
    font-size: 20px;
    margin-bottom: 8px;
}

.success-content p {
    color: var(--text-light);
    font-size: 14px;
}

/* Helper text */
.helper-text {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 4px;
}