/**
 * Login page styles
 * @package ClassroomMonitor
 * @version 1.0.0
 */
html {
    min-height: 100vh;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.main-wrapper {
    flex: 1;
    display: flex;
}

.login-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.lang-switch {
    text-align: right;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.lang-switch a {
    color: #666;
    text-decoration: none;
}

.lang-switch a:hover {
    color: #667eea;
}

.lang-switch .active {
    color: #667eea;
    font-weight: 600;
    pointer-events: none;
}

.lang-switch .sep {
    color: #999;
    margin: 0 0.35rem;
}

/* Keep "Show password" clearly below the password input, not overlapping */
.form-group input#password {
    margin-bottom: 0.5rem;
}

.show-password-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0.5rem 0 0 0;
    padding-top: 0.25rem;
    font-size: 0.9rem;
    color: #666;
    cursor: pointer;
    user-select: none;
}

.show-password-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.login-links {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.login-links a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.login-links a:hover {
    text-decoration: underline;
}

.login-links-sep {
    color: #999;
    margin: 0 0.35rem;
}

.login-forgot-link {
    color: #667eea !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}

.login-forgot-link:hover {
    text-decoration: underline !important;
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo h1 {
    color: #667eea;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
}

.logo p {
    color: #666;
    font-size: 14px;
}

.form-group {
    margin-bottom: 25px;
    text-align: center;
}

.form-group label {
    display: block;
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s;
    background: white;
    color: #333;
    box-sizing: border-box;
}

/* Form fields wrapper: same width as social login buttons row (2 × min-width + gap) */
.login-form-fields {
    max-width: 292px;
    margin-left: auto;
    margin-right: auto;
}

.login-form-fields .form-group input {
    max-width: 100%;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.form-group .forgot-password-below {
    margin: 0.75rem 0 0 0;
    font-size: 0.9rem;
}

.form-group .forgot-password-below a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.form-group .forgot-password-below a:hover {
    text-decoration: underline;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.login-form-fields .btn-login {
    max-width: 100%;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

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

.divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e0e0e0;
}

.divider span {
    background: rgba(255, 255, 255, 0.95);
    padding: 0 1rem;
    position: relative;
    color: #999;
    font-size: 0.875rem;
}

.sso-buttons {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.sso-buttons .btn-sso {
    flex: 1 1 calc(50% - 0.375rem);
    min-width: 140px;
}

.btn-sso {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 0.5rem;
    text-decoration: none;
    color: #333;
    font-weight: 600;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.btn-sso:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-sso svg {
    width: 20px;
    height: 20px;
}

.btn-azure {
    border-color: #0078d4;
}

.btn-azure:hover {
    background: #0078d4;
    color: white;
}

.btn-google {
    border-color: #4285f4;
}

.btn-google:hover {
    background: #4285f4;
    color: white;
}

.btn-discord {
    border-color: #5865f2;
}

.btn-discord:hover {
    background: #5865f2;
    color: white;
}

.btn-feide {
    border-color: #006bb3;
}

.btn-feide:hover {
    background: #006bb3;
    color: white;
}

.btn-webauthn-login {
    border-color: #0d9488;
}

.btn-webauthn-login:hover {
    background: #0d9488;
    color: white;
}

.btn-webauthn-login svg {
    flex-shrink: 0;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: #fee;
    color: #c33;
    border-left: 4px solid #c33;
}

.alert-success {
    background: #efe;
    color: #3c3;
    border-left: 4px solid #3c3;
}

.version {
    text-align: center;
    margin-top: 20px;
    color: #999;
    font-size: 12px;
}

@media (max-width: 480px) {
    .login-container {
        padding: 30px 25px;
    }

    .logo h1 {
        font-size: 28px;
    }

    .sso-buttons .btn-sso {
        flex: 1 1 100%;
    }
}
