/* Authentication Pages Stylesheet */
/* Used for: login, register, password reset pages */
/* Requires ai-native.css to be loaded first for CSS variables */

:root {
    /* Auth-specific variables */
    --auth-input-bg: rgba(255, 255, 255, 0.05);
    --auth-input-focus-bg: rgba(255, 255, 255, 0.08);
    --auth-error: #ff4444;
}

/* Auth Container - Full height centered */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* Auth Card - Main container */
.auth-card {
    background: var(--dark-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 3rem;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

/* Large Auth Card - For forms with textareas like leave-a-message */
.auth-card.auth-card-large {
    max-width: 750px;
}

.auth-card.auth-card-large .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.auth-card.auth-card-large .form-group label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--light);
}

.auth-card.auth-card-large input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
    background: var(--auth-input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--light);
    transition: all 0.2s ease;
}

.auth-card.auth-card-large input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--auth-input-focus-bg);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}

.auth-card.auth-card-large textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 300px;
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
    background: var(--auth-input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--light);
    resize: vertical;
    font-family: inherit;
    line-height: 1.6;
    transition: all 0.2s ease;
}

.auth-card.auth-card-large textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--auth-input-focus-bg);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}

.auth-card.auth-card-large textarea::placeholder,
.auth-card.auth-card-large input::placeholder {
    color: var(--gray-dark);
}

.auth-card.auth-card-large .form-help {
    color: var(--gray);
    font-size: 0.9rem;
}

/* Auth footer link - site standard style */
.auth-footer a {
    color: var(--primary, #00d4ff);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth-footer a:hover {
    color: var(--primary-light, #00ff88);
    text-decoration: underline;
}

/* Auth Header */
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--light);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.auth-header p {
    color: var(--gray);
    font-size: 1rem;
    line-height: 1.5;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    color: var(--light);
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    letter-spacing: 0.01em;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--auth-input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--light);
    font-size: 1rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--auth-input-focus-bg);
    box-shadow: 0 0 0 3px rgba(64, 203, 52, 0.1);
}

.form-input::placeholder {
    color: var(--gray-dark);
}

.form-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Form Messages */
.form-error {
    color: var(--auth-error);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: none;
    padding: 0.75rem 1rem;
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.2);
    border-radius: 6px;
}

.form-error.active {
    display: block;
    animation: slideIn 0.3s ease-out;
}

.form-success {
    color: var(--primary);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: none;
    padding: 0.75rem 1rem;
    background: rgba(64, 203, 52, 0.1);
    border: 1px solid rgba(64, 203, 52, 0.2);
    border-radius: 6px;
}

.form-success.active {
    display: block;
    animation: slideIn 0.3s ease-out;
}

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

/* Form Checkbox */
.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.form-checkbox label {
    color: var(--gray);
    font-size: 0.875rem;
    cursor: pointer;
    user-select: none;
}

.form-checkbox label:hover {
    color: var(--light);
}

/* Submit Button */
.auth-submit {
    width: 100%;
    background: var(--primary);
    color: black;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1rem;
    box-shadow: 0 4px 20px rgba(64, 203, 52, 0.2);
}

.auth-submit:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 25px rgba(64, 203, 52, 0.3);
}

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

.auth-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Loading State */
.auth-submit.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.auth-submit.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(0, 0, 0, 0.3);
    border-top-color: black;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Auth Links Section */
.auth-links {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.auth-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.auth-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.auth-link-separator {
    color: var(--gray-dark);
    margin: 0 0.5rem;
    user-select: none;
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray);
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: 2rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.back-link:hover {
    color: var(--light);
    gap: 0.75rem;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 0.5rem;
}

.password-strength-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.password-strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.password-strength-fill.weak {
    width: 33%;
    background: #ff4444;
}

.password-strength-fill.medium {
    width: 66%;
    background: #ffaa00;
}

.password-strength-fill.strong {
    width: 100%;
    background: var(--primary);
}

.password-strength-text {
    font-size: 0.75rem;
    color: var(--gray);
}

.password-strength-text.weak {
    color: #ff4444;
}

.password-strength-text.medium {
    color: #ffaa00;
}

.password-strength-text.strong {
    color: var(--primary);
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary);
    color: black;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(64, 203, 52, 0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 9999;
    max-width: 300px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.error {
    background: #ff4444;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-container {
        padding: 1rem;
    }

    .auth-card {
        padding: 2rem 1.5rem;
        border-radius: 16px;
    }

    .auth-header h1 {
        font-size: 1.75rem;
    }

    .auth-header p {
        font-size: 0.9375rem;
    }

    .form-input {
        padding: 0.75rem 0.875rem;
        font-size: 0.9375rem;
    }

    .auth-submit {
        padding: 0.875rem;
        font-size: 0.9375rem;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem 1rem;
    }

    .auth-header h1 {
        font-size: 1.5rem;
    }

    .back-link {
        font-size: 0.8125rem;
    }
}

/* Print Styles */
@media print {
    .auth-container,
    .auth-card {
        display: none;
    }
}

/* Form Messages */
.success-message {
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: rgba(64, 203, 52, 0.1);
    border: 1px solid rgba(64, 203, 52, 0.3);
    border-radius: 8px;
    color: var(--primary);
    font-size: 0.875rem;
    text-align: center;
}

.error-message {
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: rgba(255, 85, 85, 0.1);
    border: 1px solid rgba(255, 85, 85, 0.3);
    border-radius: 8px;
    color: #ff5555;
    font-size: 0.875rem;
    text-align: center;
}

.form-warning {
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    color: #ffc107;
    font-size: 0.875rem;
    text-align: center;
}

/* Invitation Banner */
.invitation-banner {
    background: linear-gradient(135deg, rgba(64, 203, 52, 0.15) 0%, rgba(64, 203, 52, 0.05) 100%);
    border: 1px solid rgba(64, 203, 52, 0.3);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.invitation-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.invitation-text {
    color: var(--light);
    font-size: 1rem;
}

.invitation-text strong {
    color: var(--primary);
}

.invitation-message {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-style: italic;
    color: var(--gray);
    font-size: 0.875rem;
}
