/* ===========================
   Auth Pages - Clean Minimal
   =========================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Page background */
.login-page,
.register-page {
    min-height: 100vh;
    background: #f8f9fb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-mode .login-page,
.dark-mode .register-page {
    background: #111827;
}

/* Centered wrapper */
.login-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 24px;
}

/* Card */
.login-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 40px 36px 36px;
}

.dark-mode .login-card {
    background: #1f2937;
    border-color: #374151;
}

/* Logo */
.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo img {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.login-logo span {
    font-size: 1.5em;
    font-weight: 700;
    color: #111827;
}

.dark-mode .login-logo span {
    color: #f9fafb;
}

/* Title */
.login-title {
    font-size: 1.35em;
    font-weight: 700;
    color: #111827;
    text-align: center;
    margin-bottom: 6px;
}

.dark-mode .login-title {
    color: #f9fafb;
}

.login-subtitle {
    font-size: 0.875em;
    color: #6b7280;
    text-align: center;
    margin-bottom: 28px;
    font-weight: 400;
}

.dark-mode .login-subtitle {
    color: #9ca3af;
}

/* Form fields */
.login-field {
    margin-bottom: 20px;
}

.login-field label {
    display: block;
    font-size: 0.8125em;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.dark-mode .login-field label {
    color: #d1d5db;
}

.login-field input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    font-size: 0.875em;
    font-family: inherit;
    color: #111827;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-field input::placeholder {
    color: #9ca3af;
}

.login-field input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.dark-mode .login-field input {
    background: #111827;
    border-color: #4b5563;
    color: #f9fafb;
}

.dark-mode .login-field input::placeholder {
    color: #6b7280;
}

.dark-mode .login-field input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Password row */
.password-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.password-label-row label {
    margin-bottom: 0;
}

.forgot-link {
    font-size: 0.8125em;
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

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

.dark-mode .forgot-link {
    color: #60a5fa;
}

.dark-mode .forgot-link:hover {
    color: #93bbfd;
}

/* Password input wrapper */
.password-input-wrap {
    position: relative;
}

.password-input-wrap input {
    padding-right: 44px;
}

.toggle-pw {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    line-height: 1;
}

.toggle-pw:hover {
    color: #6b7280;
}

.dark-mode .toggle-pw {
    color: #6b7280;
}

.dark-mode .toggle-pw:hover {
    color: #9ca3af;
}

/* Field error */
.field-error {
    display: block;
    font-size: 0.8125em;
    color: #dc2626;
    margin-top: 6px;
}

/* Login button */
.login-btn {
    width: 100%;
    height: 44px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.875em;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease;
    margin-top: 4px;
}

.login-btn:hover {
    background: #1d4ed8;
}

.login-btn:active {
    background: #1e40af;
}

.dark-mode .login-btn {
    background: #3b82f6;
}

.dark-mode .login-btn:hover {
    background: #2563eb;
}

/* Register link */
.register-section {
    text-align: center;
    margin-top: 20px;
    font-size: 0.8125em;
    color: #6b7280;
}

.register-section a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.register-section a:hover {
    text-decoration: underline;
}

.dark-mode .register-section {
    color: #9ca3af;
}

.dark-mode .register-section a {
    color: #60a5fa;
}

/* Footer */
.login-footer {
    text-align: center;
    font-size: 0.75em;
    color: #9ca3af;
    margin-top: 20px;
}

.dark-mode .login-footer {
    color: #4b5563;
}

/* Alerts */
.alert {
    border-radius: 8px;
    font-size: 0.8125em;
    padding: 10px 14px;
    margin-bottom: 16px;
    border: none;
}

.alert-danger {
    background: #fef2f2;
    color: #dc2626;
}

.alert-success {
    background: #f0fdf4;
    color: #16a34a;
}

.dark-mode .alert-danger {
    background: rgba(220, 38, 38, 0.1);
    color: #f87171;
}

.dark-mode .alert-success {
    background: rgba(22, 163, 74, 0.1);
    color: #4ade80;
}

.alert .close {
    font-size: 1.2em;
    opacity: 0.6;
}

/* ===========================
   Register page (shared)
   =========================== */
.register-page .form-outer {
    min-height: 100vh;
    max-width: 420px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.register-page .form-inner {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 40px 36px 36px;
    width: 100%;
}

.dark-mode .register-page .form-inner {
    background: #1f2937;
    border-color: #374151;
}

.register-page .logo {
    text-align: center;
    font-size: 1.5em;
    font-weight: 700;
    margin-bottom: 24px;
}

.register-page .logo span {
    color: #2563eb;
}

/* Legacy material input support for register page */
.form-group-material {
    position: relative;
    margin-bottom: 20px;
}

input.input-material {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    font-size: 0.875em;
    font-family: inherit;
    color: #111827;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input.input-material:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input.input-material ~ label {
    color: #6b7280;
    position: absolute;
    top: 12px;
    left: 14px;
    cursor: text;
    transition: all 0.2s ease;
    font-weight: 400;
    font-size: 0.875em;
}

input.input-material ~ label.active {
    font-size: 0.75em;
    top: -10px;
    left: 10px;
    background: #fff;
    padding: 0 4px;
    color: #2563eb;
    font-weight: 500;
}

input.input-material ~ label.error {
    color: #dc2626;
    font-size: 0.75em;
    position: absolute;
    top: auto;
    bottom: -20px;
    left: 0;
}

.dark-mode input.input-material {
    background: #111827;
    border-color: #4b5563;
    color: #f9fafb;
}

.dark-mode input.input-material ~ label.active {
    background: #1f2937;
    color: #60a5fa;
}

/* Shared button styles */
.btn {
    font-weight: 600;
    border: none;
    line-height: 1.5;
    transition: background 0.15s ease;
    font-family: inherit;
}

.btn-primary {
    color: #fff;
    background: #2563eb;
    border-radius: 8px;
    padding: 10px 20px;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.dark-mode .btn-primary {
    background: #3b82f6;
}

.dark-mode .btn-primary:hover {
    background: #2563eb;
}

input.form-control-custom:checked + label::before {
    background: #2563eb !important;
}

/* Responsive */
@media (max-width: 480px) {
    .login-card {
        padding: 32px 24px 28px;
    }

    .login-wrapper {
        padding: 16px;
    }
}
