/**
 * Starlight Network - Authentication Stylesheet
 * =============================================
 * Styles für Login, Register und Auth-bezogene Seiten
 */

/* Auth Page Layout */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: auto; /* allow scrolling when content is larger than viewport */
    -webkit-overflow-scrolling: touch;
    background: #050510;
}

/* Background Effects */
.auth-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(0, 243, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(167, 139, 250, 0.06) 0%, transparent 50%);
    animation: authGlow 20s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes authGlow {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-5%, -5%) rotate(5deg); }
}

/* Auth Container */
.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
}

/* Auth Card */
.auth-card {
    background: rgba(15, 15, 25, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Auth Header */
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-logo .logo-text {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
}

.auth-logo .logo-sub {
    font-size: 0.95rem;
    color: rgba(224, 224, 224, 0.5);
    margin-top: 0.25rem;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: rgba(224, 224, 224, 0.6);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

/* Form Elements */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    position: relative;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(224, 224, 224, 0.8);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #ffffff;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: rgba(0, 243, 255, 0.5);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(0, 243, 255, 0.1);
}

.form-input::placeholder {
    color: rgba(224, 224, 224, 0.4);
}

/* Input Icons */
.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.3s;
}

.form-group:focus-within .input-icon {
    opacity: 0.8;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 0.5rem;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.password-strength-bar.weak { width: 25%; background: #ef4444; }
.password-strength-bar.fair { width: 50%; background: #f59e0b; }
.password-strength-bar.good { width: 75%; background: #10b981; }
.password-strength-bar.strong { width: 100%; background: #00f3ff; }

.password-requirements {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    font-size: 0.8rem;
}

.password-requirements ul {
    list-style: none;
    display: grid;
    gap: 0.25rem;
}

.password-requirements li {
    color: rgba(224, 224, 224, 0.5);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.password-requirements li::before {
    content: '○';
    font-size: 0.6rem;
}

.password-requirements li.valid {
    color: #10b981;
}

.password-requirements li.valid::before {
    content: '✓';
    font-size: 0.75rem;
}

/* Submit Button */
.auth-submit {
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #00f3ff 0%, #00c4cc 100%);
    border: none;
    border-radius: 12px;
    color: #050510;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

.auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 243, 255, 0.3);
}

.auth-submit:active {
    transform: translateY(0);
}

.auth-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Auth Links */
.auth-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-link {
    color: rgba(0, 243, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.auth-link:hover {
    color: #00f3ff;
    text-decoration: underline;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: rgba(224, 224, 224, 0.4);
    font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

/* Flash Messages (Auth-specific) */
.auth-flash {
    margin-bottom: 1.5rem;
}

.flash-message {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    animation: flashSlideIn 0.3s ease;
    position: relative;
    overflow: hidden;
}

@keyframes flashSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.flash-message::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    animation: flashProgress 5s linear forwards;
}

@keyframes flashProgress {
    from { width: 100%; }
    to { width: 0%; }
}

.flash-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.flash-content {
    flex: 1;
}

.flash-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.flash-text {
    opacity: 0.9;
}

.flash-close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.25rem;
    line-height: 1;
    transition: opacity 0.2s;
}

.flash-close:hover {
    opacity: 1;
}

/* Flash Types */
.flash-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.flash-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.flash-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}

.flash-info {
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid rgba(0, 243, 255, 0.3);
    color: #00f3ff;
}

/* Debug Flash (for developers) */
.flash-debug {
    background: rgba(167, 139, 250, 0.15);
    border: 1px solid rgba(167, 139, 250, 0.3);
    color: #a78bfa;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.8rem;
}

.flash-debug .flash-content {
    white-space: pre-wrap;
    word-break: break-all;
}

/* Remember Me Checkbox */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.checkbox-input {
    width: 18px;
    height: 18px;
    accent-color: #00f3ff;
    cursor: pointer;
}

.checkbox-label {
    font-size: 0.9rem;
    color: rgba(224, 224, 224, 0.8);
    cursor: pointer;
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 2rem;
}

.auth-footer p {
    color: rgba(224, 224, 224, 0.5);
    font-size: 0.85rem;
}

.auth-footer a {
    color: #00f3ff;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Brand Link */
.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    color: rgba(224, 224, 224, 0.4);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.auth-brand:hover {
    color: rgba(224, 224, 224, 0.7);
}

.auth-brand span {
    color: #00f3ff;
}

/* Responsive */
@media (max-width: 480px) {
    .auth-page {
        padding: 1rem;
        align-items: flex-start; /* snap to top on small screens to avoid content being centered off-screen */
        padding-top: 2rem;
    }
    
    .auth-card {
        padding: 1.5rem;
        border-radius: 16px;
    }
    
    .auth-title {
        font-size: 1.5rem;
    }
    
    .auth-links {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
}

/* If viewport height is small (e.g. mobile keyboard open), allow top-aligned scrolling */
@media (max-height: 700px) {
    .auth-page {
        align-items: flex-start;
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    .auth-container {
        margin-top: 0.5rem;
    }
}

/* Loading State */
.auth-submit.loading {
    pointer-events: none;
    position: relative;
    color: transparent;
}

.auth-submit.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: #050510;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Additional Auth Styles (missing elements)
   ============================================ */

/* Bonus Badge */
.bonus-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 193, 7, 0.1));
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    color: #ffd700;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.bonus-icon {
    font-size: 1.1rem;
}

/* Form Label with Icon */
.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(224, 224, 224, 0.8);
    margin-bottom: 0.5rem;
}

.label-icon {
    font-size: 0.9rem;
}

/* Input Wrapper */
.input-wrapper {
    position: relative;
}

.input-status {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.input-wrapper.valid .input-status::after {
    content: '✓';
    color: #10b981;
    opacity: 1;
}

.input-wrapper.invalid .input-status::after {
    content: '✕';
    color: #ef4444;
    opacity: 1;
}

/* Password Wrapper */
.password-wrapper .form-input {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(224, 224, 224, 0.5);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: rgba(224, 224, 224, 0.8);
}

.eye-icon {
    display: block;
}

/* Form Hint */
.form-hint {
    font-size: 0.75rem;
    color: rgba(224, 224, 224, 0.4);
    margin-top: 0.35rem;
}

/* Validation Message */
.validation-message {
    font-size: 0.8rem;
    margin-top: 0.35rem;
    min-height: 1.2em;
}

.validation-message.error {
    color: #ef4444;
}

.validation-message.success {
    color: #10b981;
}

/* Password Strength Container */
.password-strength-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.password-strength-text {
    font-size: 0.75rem;
    color: rgba(224, 224, 224, 0.5);
}

/* Password Requirements */
.password-requirements {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    font-size: 0.8rem;
}

.requirement {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(224, 224, 224, 0.5);
    margin-bottom: 0.25rem;
}

.requirement:last-child {
    margin-bottom: 0;
}

.requirement.valid {
    color: #10b981;
}

.requirement .req-icon {
    font-size: 0.65rem;
}

.requirement.valid .req-icon {
    content: '✓';
}

/* Form Options (Remember me + Forgot) */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.forgot-link {
    color: rgba(224, 224, 224, 0.6);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: #00f3ff;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: rgba(224, 224, 224, 0.7);
}

.form-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #00f3ff;
    cursor: pointer;
}

.checkbox-custom {
    display: none; /* Hide if not styled */
}

.terms-label {
    font-size: 0.8rem;
    line-height: 1.4;
}

.terms-link {
    color: #00f3ff;
    text-decoration: none;
}

.terms-link:hover {
    text-decoration: underline;
}

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #00f3ff 0%, #00c4cc 100%);
    border: none;
    border-radius: 12px;
    color: #050510;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
    position: relative;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 243, 255, 0.3);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-text {
    display: inline-block;
}

.btn-loader {
    display: none;
}

.btn-submit.loading .btn-text {
    visibility: hidden;
}

.btn-submit.loading .btn-loader {
    display: block;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: #050510;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Flash Container in Auth */
.flash-container {
    margin-bottom: 1rem;
}

/* Stars background */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Ensure auth-container is above stars */
.auth-page .auth-container {
    z-index: 10;
}
