/* ============================================
   AUTH PAGES STYLES
   Hon. Mwangi Nyagah Portal - Login & Register
   Matching main site design system
============================================ */

/* CSS Variables - Matching Main Site */
:root {
    --primary: #1a5f3f;
    --primary-light: #2d7a56;
    --primary-dark: #0f4728;
    --secondary: #d4a574;
    --secondary-light: #e6c9a5;
    --accent: #c8102e;
    --bg-light: #fafaf8;
    --bg-dark: #0f1a14;
    --text-dark: #1a1a1a;
    --text-light: #f5f5f5;
    --border: #e0ddd5;
    --border-light: #f0eee9;
    --shadow: rgba(26, 95, 63, 0.1);
    --shadow-dark: rgba(0, 0, 0, 0.2);
    --success: #28a745;
    --error: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Work Sans', sans-serif;
    color: var(--text-dark);
    background: var(--bg-light);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: 'Crimson Pro', serif;
    font-weight: 700;
    line-height: 1.2;
}

/* Button Styles - Matching Main Site */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--primary);
    color: white;
    padding: 0.8rem 1.8rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-family: 'Work Sans', sans-serif;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1rem;
    line-height: 1.5;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px var(--shadow);
}

.btn:active {
    transform: translateY(0);
}

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

.btn-full {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

.btn i {
    font-size: 1.1em;
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
}

/* Auth Container */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

/* Background Pattern */
.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 50%);
    animation: float 20s infinite linear;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    33% {
        transform: translateY(-20px) rotate(120deg);
    }
    66% {
        transform: translateY(20px) rotate(240deg);
    }
}

/* Auth Box */
.auth-box {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    animation: slideUp 0.6s ease-out;
}

.auth-box.register {
    max-width: 600px;
}

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

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 1.5rem;
    transition: all 0.3s;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background: rgba(26, 95, 63, 0.1);
}

.back-link:hover {
    background: rgba(26, 95, 63, 0.2);
    transform: translateX(-5px);
    text-decoration: none;
}

.back-link i {
    transition: transform 0.3s;
}

.back-link:hover i {
    transform: translateX(-3px);
}

/* Auth Header */
.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
    padding-bottom: 1.5rem;
}

.auth-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--secondary);
    border-radius: 2px;
}

.auth-header h1 {
    color: var(--primary);
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-header p {
    color: #666;
    font-size: 1.1rem;
    max-width: 80%;
    margin: 0 auto;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.8rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
}

.form-group .label-required::after {
    content: ' *';
    color: var(--accent);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-family: 'Work Sans', sans-serif;
    font-size: 1rem;
    transition: all 0.3s;
    background: white;
    color: var(--text-dark);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 95, 63, 0.1);
    transform: translateY(-1px);
}

.form-group input:disabled,
.form-group select:disabled {
    background: var(--bg-light);
    cursor: not-allowed;
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: #666;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Form Icons */
.form-group.with-icon {
    position: relative;
}

.form-group.with-icon input,
.form-group.with-icon select {
    padding-left: 3rem;
}

.form-group.with-icon i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 1.2rem;
    pointer-events: none;
}

/* Alert Messages */
.alert {
    padding: 1.2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    animation: fadeIn 0.3s ease;
    border: 1px solid transparent;
}

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

.alert i {
    font-size: 1.2rem;
    margin-top: 0.1rem;
}

.alert-content {
    flex: 1;
}

.alert-error {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.05));
    border-color: rgba(220, 53, 69, 0.2);
    color: var(--error);
}

.alert-success {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(40, 167, 69, 0.05));
    border-color: rgba(40, 167, 69, 0.2);
    color: var(--success);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 193, 7, 0.05));
    border-color: rgba(255, 193, 7, 0.2);
    color: var(--warning);
}

.alert-info {
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.1), rgba(23, 162, 184, 0.05));
    border-color: rgba(23, 162, 184, 0.2);
    color: var(--info);
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 0.5rem;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.strength-meter {
    height: 100%;
    width: 0;
    border-radius: 3px;
    transition: all 0.3s;
}

.strength-weak { width: 33%; background: var(--error); }
.strength-medium { width: 66%; background: var(--warning); }
.strength-strong { width: 100%; background: var(--success); }

/* Terms & Conditions */
.terms-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.terms-checkbox input[type="checkbox"] {
    margin-top: 0.2rem;
    width: 1.2rem;
    height: 1.2rem;
    accent-color: var(--primary);
}

.terms-checkbox label {
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
    cursor: pointer;
}

.terms-checkbox a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.terms-checkbox a:hover {
    text-decoration: underline;
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: #666;
}

.auth-footer p {
    margin-bottom: 0.5rem;
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

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

.auth-footer .demo-note {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--secondary);
    font-style: italic;
    padding: 0.5rem;
    background: rgba(212, 165, 116, 0.1);
    border-radius: 6px;
}

/* Logo Section */
.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-container {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.logo-circle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.5rem;
    border: 3px solid white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.logo-text h1 {
    color: var(--primary);
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
    background: none;
    -webkit-text-fill-color: var(--primary);
}

.logo-text p {
    color: var(--secondary);
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-container {
        padding: 1rem;
    }
    
    .auth-box {
        padding: 2rem;
        border-radius: 16px;
    }
    
    .auth-header h1 {
        font-size: 1.8rem;
    }
    
    .auth-header p {
        font-size: 1rem;
    }
    
    .btn-full {
        padding: 0.9rem;
        font-size: 1rem;
    }
    
    .logo-container {
        flex-direction: column;
        text-align: center;
        gap: 0.8rem;
    }
    
    .logo-circle {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .auth-box {
        padding: 1.5rem;
    }
    
    .auth-header h1 {
        font-size: 1.6rem;
    }
    
    .form-group input,
    .form-group select {
        padding: 0.9rem;
    }
    
    .alert {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

/* Loading State */
.btn-loading {
    position: relative;
    color: transparent;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Form Validation States */
.form-group.valid input,
.form-group.valid select {
    border-color: var(--success);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2328a745'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 20px;
    padding-right: 3rem;
}

.form-group.invalid input,
.form-group.invalid select {
    border-color: var(--error);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23dc3545'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 20px;
    padding-right: 3rem;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 0.2rem;
    font-size: 1.2rem;
}

/* Success Animation */
.success-animation {
    text-align: center;
    padding: 2rem 0;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 2.5rem;
    animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .auth-box,
    .alert,
    .btn,
    .back-link {
        animation: none;
        transition: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary: #003300;
        --primary-light: #006600;
        --secondary: #996600;
        --text-dark: #000000;
        --border: #000000;
    }
    
    .auth-box {
        border: 2px solid var(--border);
    }
}

/* Print Styles */
@media print {
    .auth-container {
        background: white !important;
    }
    
    .auth-box {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .btn,
    .back-link {
        display: none;
    }
}