/* service/static/service/css/login.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, #2563eb 0%, #1e40af 50%, #1e3a8a 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 25% 75%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 25%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(30, 64, 175, 0.1) 100%);
    pointer-events: none;
    z-index: 0;
}

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

/* 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;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

/* 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-tools::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: #1e40af;
    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: #64748b;
    font-size: 1.125rem;
    font-weight: 500;
}

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

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

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

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

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

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

.input-wrapper input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    transform: translateY(-1px);
}

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

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

.input-wrapper:focus-within i {
    color: #2563eb;
}

.field-hint {
    display: block;
    margin-top: 0.5rem;
    color: #6b7280;
    font-size: 0.8125rem;
    font-weight: 500;
}

/* Icon styles using pseudo-elements */
.icon-badge::before { content: '🆔'; }
.icon-lock::before { content: '🔒'; }
.icon-eye::before { content: '👁️'; }
.icon-eye-off::before { content: '🙈'; }
.icon-check::before { content: '✅'; }
.icon-login::before { content: '🚀'; }
.icon-student::before { content: '🎓'; }
.icon-admin::before { content: '👨‍💼'; }
.icon-warning::before { content: '⚠️'; }
.icon-award::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: #6b7280;
    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: #2563eb;
    background: rgba(37, 99, 235, 0.08);
}

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

/* Error Messages */
.error-message {
    display: block;
    color: #dc2626;
    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;
}

.global-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 0.75rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

/* 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;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.alert-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid #34d399;
}

.alert-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border: 1px solid #60a5fa;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    font-weight: bold;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.close-btn:hover {
    opacity: 1;
}

/* 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: #4b5563;
}

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

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

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    border-color: #2563eb;
    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-password {
    color: #2563eb;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.forgot-password:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 1.125rem 1.5rem;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 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;
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
}

.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(37, 99, 235, 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: 0 8px 25px rgba(37, 99, 235, 0.2);
}

.btn-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: opacity 0.2s ease;
}

.btn-loader {
    display: none;
}

.spinner {
    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 .btn-loader {
    display: block;
}

.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;
    margin-top: 1rem;
}

.auth-footer p {
    color: #64748b;
    font-size: 0.9375rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.support-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.support-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.portal-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
}

.portal-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 0.5rem;
    border-radius: 6px;
}

.portal-link:hover {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.05);
    transform: translateY(-1px);
}

/* Auth Sidebar */
.auth-sidebar {
    flex: 0 0 450px;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.95), rgba(30, 58, 138, 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;
    width: 100%;
}

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

.features {
    margin-bottom: 2.5rem;
}

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

.feature i {
    font-size: 1.25rem;
}

.expert-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.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.875rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

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

.specialist-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 600;
    font-size: 0.9375rem;
}

.specialist-badge i {
    font-size: 1.25rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    display: flex;
    opacity: 1;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.spinner-ring {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.loading-text {
    font-size: 1.125rem;
    font-weight: 500;
}

/* Validation States */
.input-wrapper input.invalid {
    border-color: #dc2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

.input-wrapper input.valid {
    border-color: #16a34a;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.12);
}

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

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

    .auth-card {
        padding: 1.5rem;
    }

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

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

    .portal-links {
        flex-direction: column;
        gap: 0.75rem;
    }

    .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 {
        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;
    }
}