/* hr.maxrelax — login page (depends on theme.css for palette) */

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", sans-serif;
    background: #f0f2f5;
    overflow: hidden;
}

.login-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ===== Left panel — branding ===== */
.login-brand-panel {
    flex: 1;
    background: linear-gradient(135deg,
        var(--max-primary-900) 0%,
        var(--max-primary-700) 50%,
        var(--max-primary-500) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 40px;
}

.login-brand-panel::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -20%;
    width: 140%;
    height: 140%;
    background: radial-gradient(ellipse at 30% 50%, rgba(1, 255, 255, 0.18) 0%, transparent 70%);
    pointer-events: none;
}

.login-brand-panel::after {
    content: '';
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(ellipse at center, rgba(0, 255, 207, 0.28) 0%, transparent 70%);
    pointer-events: none;
}

.brand-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}

.brand-shapes .shape { position: absolute; }
.brand-shapes .shape svg { width: 100%; height: 100%; }

.brand-shapes .shape-1 {
    width: 560px; height: 600px;
    top: -120px; left: -80px;
    transform: rotate(-10deg);
    opacity: 0.10;
}
.brand-shapes .shape-2 {
    width: 380px; height: 400px;
    bottom: 8%; right: -60px;
    transform: rotate(15deg);
    opacity: 0.07;
}
.brand-shapes .shape-3 {
    width: 260px; height: 280px;
    top: 45%; right: 10%;
    transform: rotate(-5deg);
    opacity: 0.06;
}

.brand-logo {
    position: relative;
    z-index: 2;
    margin-bottom: 30px;
    text-align: center;
}

.brand-logo img {
    width: 540px;
    max-width: 80vw;
    height: auto;
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.25));
}

.brand-tagline {
    position: relative;
    z-index: 2;
    color: rgba(255, 255, 255, 0.95);
    font-size: 22px;
    font-weight: 600;
    text-align: center;
    max-width: 540px;
    line-height: 1.6;
    letter-spacing: 0.3px;
    margin: 0;
}

/* ===== Right panel — form ===== */
.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: #fff;
}

.login-form-container {
    width: 100%;
    max-width: 400px;
}

.login-form-container h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--max-primary-900);
    margin: 0 0 8px 0;
}

.login-subtitle {
    font-size: 15px;
    color: #6b7280;
    margin: 0 0 35px 0;
    font-weight: 400;
}

.form-group-custom { margin-bottom: 22px; }

.form-group-custom label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 7px;
    letter-spacing: 0.2px;
}

.input-wrapper { position: relative; }

.input-wrapper .field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
    display: flex;
    align-items: center;
}

.form-group-custom input[type="text"],
.form-group-custom input[type="password"],
.form-group-custom input[type="email"] {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    color: #1f2937;
    background: #f9fafb;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
}

.form-group-custom input:focus {
    border-color: var(--max-primary-500);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 103, 246, 0.15);
}

.form-group-custom input.has-error {
    border-color: #dc2626;
    background: #fef2f2;
}

.form-group-custom input.has-error:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.field-error {
    display: none;
    margin-top: 6px;
    font-size: 12px;
    color: #dc2626;
    font-weight: 500;
    line-height: 1.3;
}

.field-error.is-visible { display: block; }

.form-group-custom input::placeholder { color: #9ca3af; }

/* Remove browser autofill yellow/blue background */
.form-group-custom input:-webkit-autofill,
.form-group-custom input:-webkit-autofill:hover,
.form-group-custom input:-webkit-autofill:focus,
.form-group-custom input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #f9fafb inset !important;
    box-shadow: 0 0 0 1000px #f9fafb inset !important;
    -webkit-text-fill-color: #1f2937 !important;
    caret-color: #1f2937;
    transition: background-color 9999s ease-in-out 0s;
}

.form-group-custom input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #fff inset, 0 0 0 3px rgba(0, 103, 246, 0.15) !important;
    box-shadow: 0 0 0 1000px #fff inset, 0 0 0 3px rgba(0, 103, 246, 0.15) !important;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.toggle-password:hover { color: var(--max-primary-600); }

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}
.form-options--end { justify-content: flex-end; }

.form-options a {
    font-size: 13px;
    color: var(--max-primary-600);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.form-options a:hover {
    color: var(--max-primary-400);
    text-decoration: underline;
}

.btn-login {
    width: 100%;
    padding: 13px 24px;
    background: linear-gradient(135deg, var(--max-primary-700) 0%, var(--max-primary-500) 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 15px rgba(0, 103, 246, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(1, 255, 255, 0.35), 0 6px 18px rgba(0, 103, 246, 0.4);
}

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

.login-alert {
    display: none;
    margin-top: 18px;
    padding: 13px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, #fff5f5 0%, #fef2f2 100%);
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.08);
    align-items: flex-start;
    gap: 11px;
    position: relative;
    overflow: hidden;
}

.login-alert::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #ef4444;
    border-radius: 12px 0 0 12px;
}

.login-alert.is-visible {
    display: flex;
    animation: alertSlideIn 0.3s ease-out;
}

.login-alert__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

.login-alert__text { flex: 1; }

.login-alert.success {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border-color: #a7f3d0;
    color: #047857;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.08);
}
.login-alert.success::before { background: #10b981; }
.login-alert.success .login-alert__icon { background: #10b981; }

@keyframes alertSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* register variant — taller form, allow scroll */
body.has-register { overflow: auto; }
body.has-register .login-form-panel { padding: 40px; }
.form-row { display: flex; gap: 14px; }
.form-row .form-group-custom { flex: 1; }
.form-footnote {
    margin-top: 18px;
    text-align: center;
    font-size: 13px;
    color: #6b7280;
}
.form-footnote a {
    color: var(--max-primary-600);
    font-weight: 600;
    text-decoration: none;
}
.form-footnote a:hover { text-decoration: underline; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    body { overflow: auto; }
    .login-wrapper { flex-direction: column; }

    .login-brand-panel {
        min-height: 220px;
        flex: 0 0 auto;
        padding: 30px 20px;
    }
    .brand-logo img { width: 280px; }
    .brand-fallback { font-size: 36px; }
    .brand-tagline { font-size: 15px; }

    .login-form-panel { padding: 30px 24px; }
    .login-form-container h1 { font-size: 24px; }
}
