/* ==========================================================================
   Synaplan Authentication Pages - Stylesheet
   Based on widget API reference design with blue background and white form boxes
   ========================================================================== */

@import url('https://api.fontshare.com/v2/css?f[]=satoshi@900,700,500,301,701,300,501,401,901,400&display=swap');

:root {
    --synaplan-primary: #061c3e;
    --synaplan-secondary: #64748b;
    --synaplan-accent: #00E5FF;
    --synaplan-accent-secondary: #00FF9D;
    --synaplan-dark: #0f172a;
    --synaplan-light: #f8fafc;
    --synaplan-blue-bg: #0a2147;
    --synaplan-blue-bg-alt: #061c3e;
}

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

body {
    font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--synaplan-blue-bg) 0%, var(--synaplan-blue-bg-alt) 50%, var(--synaplan-blue-bg) 100%);
    color: white;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.3;
    z-index: 0;
}

/* Header with logo */
.auth-header {
    position: relative;
    z-index: 2;
    padding: 20px 0 10px;
    text-align: center;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: white;
    text-decoration: none;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.auth-logo img {
    height: 40px;
    width: auto;
}

.auth-logo:hover {
    color: var(--synaplan-accent);
    text-decoration: none;
}

.auth-welcome {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    font-weight: 500;
}

/* Main container */
.auth-container {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: 20px;
}

/* Form box */
.auth-form-box {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 500px;
    position: relative;
}

/* Form title */
.auth-form-title {
    color: var(--synaplan-primary);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
}

/* Form description */
.auth-form-description {
    color: var(--synaplan-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 30px;
    text-align: center;
}

/* Form groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    color: var(--synaplan-primary);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
    display: block;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    color: var(--synaplan-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--synaplan-accent);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.1);
}

.form-control::placeholder {
    color: #9ca3af;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--synaplan-accent) 0%, var(--synaplan-accent-secondary) 100%);
    color: var(--synaplan-primary);
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 10px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #00c4a7 0%, #00b49a 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 212, 170, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-outline-primary {
    background: transparent;
    color: var(--synaplan-accent);
    border: 2px solid var(--synaplan-accent);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-outline-primary:hover {
    background: var(--synaplan-accent);
    color: var(--synaplan-primary);
}

/* Links */
.auth-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.auth-link:hover {
    color: #0056b3;
    text-decoration: none;
}

/* Alerts */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: none;
    font-size: 0.9rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

/* Turnstile */
.cf-turnstile {
    margin: 20px 0;
    display: flex;
    justify-content: center;
}

/* Footer links */
.auth-footer {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.auth-footer a {
    color: #6c757d;
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    color: #495057;
    text-decoration: none;
}

/* Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* SSO Section */
.sso-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.sso-section p {
    color: var(--synaplan-secondary);
    margin-bottom: 15px;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-header {
        padding: 15px 0 5px;
    }
    
    .auth-logo {
        font-size: 1.5rem;
    }
    
    .auth-logo img {
        height: 32px;
    }
    
    .auth-container {
        min-height: calc(100vh - 150px);
        padding: 10px;
    }
    
    .auth-form-box {
        padding: 30px 20px;
        margin: 0 10px;
        width: calc(100% - 20px);
        max-width: none;
    }
    
    .auth-form-title {
        font-size: 1.5rem;
    }
    
    .form-control {
        padding: 14px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .btn-primary {
        padding: 16px 24px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .auth-form-box {
        padding: 25px 15px;
        margin: 0 5px;
        width: calc(100% - 10px);
    }
    
    .auth-form-title {
        font-size: 1.3rem;
    }
    
    .auth-form-description {
        font-size: 0.9rem;
    }
}

/* Animation for form appearance */
.auth-form-box {
    animation: slideInUp 0.6s ease-out;
}

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

/* Loading state */
.btn-primary:disabled .spinner-border {
    display: inline-block !important;
}

/* Focus states for accessibility */
.form-control:focus,
.btn-primary:focus,
.btn-outline-primary:focus {
    outline: 2px solid var(--synaplan-accent);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-control {
        border-width: 3px;
    }
    
    .btn-primary {
        border: 2px solid var(--synaplan-primary);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .auth-form-box {
        animation: none;
    }
    
    .btn-primary:hover {
        transform: none;
    }
    
    * {
        transition: none !important;
    }
}
