/* student/static/student/css/auth.css */

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

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #1a202c;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Auth Container */
.auth-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.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%),
        linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    pointer-events: none;
}

/* Auth Card */
.auth-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    position: relative;
    z-index: 1;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.register-card {
    background: rgba(255, 255, 255, 0.99);
}

/* Auth Header */
.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
    width: 100%;
    max-width: 420px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    gap: 0.75rem;
}

.logo .icon-home::before {
    content: '🏠';
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2d3748;
    letter-spacing: -0.025em;
}

.auth-header h2 {
    font-size: 2.25rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
}

.auth-header p {
    color: #718096;
    font-size: 1.125rem;
    font-weight: 400;
}

/* Auth Form */
.auth-form {
    width: 100%;
    max-width: 420px;
}

.register-card .auth-form {
    max-width: 520px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.625rem;
    font-weight: 600;
    color: #2d3748;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-wrapper input,
.input-wrapper select {
    width: 100%;
    height: 3.5rem;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 400;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    color: #1a202c;
    line-height: 1.5;
}

.input-wrapper.password-input {
    position: relative;
    height: auto;
}

.input-wrapper.password-input input {
    padding-right: 3.25rem;
    height: 3.5rem;
}

.input-wrapper input:focus,
.input-wrapper select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.12);
    transform: translateY(-1px);
}

.input-wrapper input::placeholder {
    color: #a0aec0;
    font-weight: 400;
}

.input-wrapper i {
    position: absolute;
    left: 1rem;
    color: #718096;
    z-index: 2;
    font-size: 1.125rem;
    transition: color 0.2s ease;
}

.input-wrapper:focus-within i {
    color: #667eea;
}

/* Icon styles using pseudo-elements */
.icon-user::before { content: '👤'; }
.icon-lock::before { content: '🔒'; }
.icon-mail::before { content: '📧'; }
.icon-phone::before { content: '📱'; }
.icon-building::before { content: '🏢'; }
.icon-door::before { content: '🚪'; }
.icon-id::before { content: '🆔'; }
.icon-eye::before { content: '👁️'; }
.icon-eye-off::before { content: '🙈'; }
.icon-check::before { content: '✅'; }

.toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 0;
    bottom: 0;
    margin: auto;
    height: 2.5rem;
    width: 2.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #718096;
    font-size: 1.125rem;
    z-index: 3;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.08);
}

.toggle-password:active {
    transform: scale(0.95);
}

.error-message {
    display: block;
    color: #e53e3e;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-top: 0.5rem;
    min-height: 1.125rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.error-message:not(:empty) {
    opacity: 1;
}

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

.strength-meter {
    width: 100%;
    height: 6px;
    background-color: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    position: relative;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 3px;
    background-color: #e5e7eb;
}

/* Strength Colors */
.strength-fill.weak {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.strength-fill.fair {
    background: linear-gradient(90deg, #f97316, #fb923c);
}

.strength-fill.good {
    background: linear-gradient(90deg, #eab308, #facc15);
}

.strength-fill.strong {
    background: linear-gradient(90deg, #22c55e, #4ade80);
}

.strength-text {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    transition: color 0.3s ease;
}

/* Text colors for different strengths */
.password-strength.weak .strength-text {
    color: #ef4444;
}

.password-strength.fair .strength-text {
    color: #f97316;
}

.password-strength.good .strength-text {
    color: #eab308;
}

.password-strength.strong .strength-text {
    color: #22c55e;
}

/* Messages */
.messages {
    margin-bottom: 1.5rem;
}

.alert {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: opacity 0.3s ease;
}

.alert-error {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    color: #c53030;
    border: 1px solid #fbb6ce;
}

.alert-success {
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
    color: #2f855a;
    border: 1px solid #68d391;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #4a5568;
}

.checkbox-wrapper input[type="checkbox"] {
    opacity: 0;
    position: absolute;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e0;
    border-radius: 6px;
    position: relative;
    transition: all 0.2s ease;
    background: #ffffff;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: #667eea;
    transform: scale(1.05);
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 13px;
    font-weight: bold;
}

.forgot-link {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.forgot-link:hover {
    color: #553c9a;
    text-decoration: underline;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 1.125rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.0625rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
    letter-spacing: 0.025em;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:active {
    transform: translateY(-1px);
}

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

.spinner {
    display: none;
    width: 22px;
    height: 22px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top: 2.5px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
}

.btn-primary.loading .btn-text {
    opacity: 0.7;
}

.btn-primary.loading .spinner {
    display: block;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Auth Footer */
.auth-footer {
    text-align: center;
}

.auth-footer p {
    color: #718096;
    font-size: 0.9375rem;
    font-weight: 500;
}

.auth-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.auth-footer a:hover {
    color: #553c9a;
    text-decoration: underline;
}

/* Auth Sidebar */
.auth-sidebar {
    flex: 0 0 420px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.95), rgba(118, 75, 162, 0.95));
    color: white;
    padding: 3rem 2.5rem;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.auth-sidebar::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 30% 70%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: float 8s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(3deg); }
}

.sidebar-content {
    position: relative;
    z-index: 1;
}

.sidebar-content h3 {
    font-size: 2rem;
    margin-bottom: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.feature-list {
    list-style: none;
    margin-bottom: 2.5rem;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    font-size: 1.0625rem;
    font-weight: 500;
}

.feature-list i {
    font-size: 1.375rem;
}

.stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 2.5rem;
}

.stat-item {
    text-align: center;
    padding: 1.5rem 1rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
}

.stat-number {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.stat-label {
    font-size: 0.8125rem;
    opacity: 0.9;
    font-weight: 500;
}

/* Validation States */
.input-wrapper input.invalid,
.input-wrapper select.invalid {
    border-color: #e53e3e;
    box-shadow: 0 0 0 4px rgba(229, 62, 62, 0.12);
}

.input-wrapper input.valid,
.input-wrapper select.valid {
    border-color: #38a169;
    box-shadow: 0 0 0 4px rgba(56, 161, 105, 0.12);
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-container {
        flex-direction: column;
    }

    .auth-sidebar {
        flex: none;
        min-height: 220px;
        padding: 2rem 1.5rem;
    }

    .auth-card {
        padding: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .auth-header h2 {
        font-size: 1.875rem;
    }

    .sidebar-content h3 {
        font-size: 1.5rem;
    }
}

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

    .auth-header h2 {
        font-size: 1.625rem;
    }

    .input-wrapper input,
    .input-wrapper select {
        padding: 0.75rem 0.75rem 0.75rem 2.5rem;
        font-size: 0.9375rem;
    }

    .input-wrapper.password-input input {
        padding-right: 3.25rem;
    }

    .btn-primary {
        padding: 1rem 1.25rem;
        font-size: 1rem;
    }

    .stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .auth-header h2 {
        font-size: 1.875rem;
    }

    .sidebar-content h3 {
        font-size: 1.5rem;
    }
}
