:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --success-color: #27ae60;
    --error-color: #e74c3c;
    --warning-color: #f39c12;
    --light-bg: #ecf0f1;
    --white: #ffffff;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --border-color: #bdc3c7;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Login Container */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--white);
    top: -100px;
    right: -100px;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: var(--white);
    bottom: -50px;
    left: -50px;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: var(--white);
    top: 50%;
    left: 10%;
}

/* Login Card */
.login-card {
    background: var(--white);
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 1;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Login Header */
.login-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--light-bg);
    padding-bottom: 20px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 8px;
}

.subtitle {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 15px;
}

.date-time {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 13px;
    color: var(--primary-color);
    font-weight: 600;
}

.date-time span {
    padding: 5px 12px;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(52, 152, 219, 0.05) 100%);
    border-radius: 20px;
    border: 1px solid rgba(52, 152, 219, 0.2);
}

/* Login Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Form Group */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.label-text {
    display: block;
}

.required {
    color: var(--error-color);
    font-weight: 700;
}

.readonly-badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    background: var(--light-bg);
    color: var(--text-light);
    border-radius: 12px;
    font-weight: 500;
}

/* Input Wrapper */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

input[type="text"],
input[type="email"],
select {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: var(--white);
    color: var(--text-dark);
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

input[readonly] {
    background: linear-gradient(135deg, #f8f9fa 0%, #f0f2f5 100%);
    cursor: not-allowed;
    color: var(--text-light);
}

input[readonly]:focus {
    border-color: var(--border-color);
    box-shadow: none;
}

select {
    appearance: none;
    cursor: pointer;
    padding-right: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%233498db' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f8f9fa;
}

/* Input Icons */
.input-icon {
    position: absolute;
    right: 12px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    font-size: 12px;
}

.input-icon::before {
    content: '';
    width: 4px;
    height: 4px;
    background: var(--text-light);
    border-radius: 50%;
}

.readonly-icon::before {
    content: '🔒';
    width: auto;
    height: auto;
    background: none;
    font-size: 14px;
}

.select-icon::before {
    content: '';
    display: none;
}

/* Input States */
.form-group.success input,
.form-group.success select {
    border-color: var(--success-color);
    background-image: linear-gradient(135deg, rgba(39, 174, 96, 0.05) 0%, rgba(39, 174, 96, 0.02) 100%);
}

.form-group.success input:focus,
.form-group.success select:focus {
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

.form-group.error input,
.form-group.error select {
    border-color: var(--error-color);
}

.form-group.error input:focus,
.form-group.error select:focus {
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* Messages */
.error-message,
.success-message,
.info-message,
.course-info {
    font-size: 12px;
    min-height: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.error-message {
    color: var(--error-color);
}

.error-message::before {
    content: '⚠';
}

.success-message {
    color: var(--success-color);
}

.success-message::before {
    content: '✓';
}

.info-message {
    color: var(--primary-color);
    font-size: 11px;
}

.info-message::before {
    content: 'ℹ';
}

.course-info {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.05) 0%, rgba(52, 152, 219, 0.02) 100%);
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
    color: var(--primary-color);
    font-size: 12px;
    margin-top: 4px;
}

.course-info::before {
    content: '📚';
    margin-right: 4px;
}

.general-error {
    grid-column: 1 / -1;
    padding: 12px;
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1) 0%, rgba(231, 76, 60, 0.05) 100%);
    border-radius: 6px;
    border-left: 3px solid var(--error-color);
}

/* Button */
.btn-login {
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #2980b9 100%);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.btn-login:active:not(:disabled) {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-loader {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-loader.hidden {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Login Footer */
.login-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--light-bg);
}

.footer-text {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 6px;
    font-weight: 500;
}

.footer-help {
    font-size: 11px;
    color: var(--text-light);
}

/* Responsive Design */
@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
        border-radius: 12px;
    }

    .login-header h1 {
        font-size: 24px;
    }

    .date-time {
        flex-direction: column;
        gap: 8px;
    }

    input[type="text"],
    input[type="email"],
    select {
        padding: 11px 36px 11px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .btn-login {
        padding: 12px 18px;
        font-size: 14px;
    }

    .form-group label {
        font-size: 13px;
    }
}

/* Print Styles */
@media print {
    .login-container {
        display: none;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --white: #1a1a1a;
        --light-bg: #2a2a2a;
        --text-dark: #e0e0e0;
        --text-light: #b0b0b0;
        --border-color: #404040;
        --shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }

    input[readonly] {
        background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    }

    select:disabled {
        background-color: #2a2a2a;
    }
}
