* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f1f5f9;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Layout ── */
.login-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
}

.login-image {
    display: none;
    position: relative;
    flex: 1;
    overflow: hidden;
}

.login-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.login-image .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom right, rgba(13, 31, 23, 0.68), rgba(13, 31, 23, 0.55));
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 3rem;
}

.login-image .text-content {
    color: #fff;
    max-width: 420px;
    margin-right: clamp(0.5rem, 3vw, 2.5rem);
    text-align: left;
    text-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.login-image h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    letter-spacing: -.02em;
}

.login-image p {
    font-size: 1rem;
    margin: 0;
    opacity: .75;
}

.login-form-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    padding: 2rem;
}

.login-box {
    width: 100%;
    max-width: 400px;
    animation: slideUp .45s cubic-bezier(.16,1,.3,1) both;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Logo & heading ── */
.logo-section {
    text-align: center;
    margin-bottom: 2.25rem;
}

.logo-wrapper {
    margin: 0 auto 1.25rem;
    display: flex;
    justify-content: center;
}

.logo-img {
    max-width: 160px;
    height: auto;
}

.logo-section h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand-ink, #1B2420);
    margin: 0 0 .35rem;
    letter-spacing: -.02em;
}

.subtitle {
    color: var(--brand-muted, #6B7A73);
    font-size: 0.875rem;
    margin: 0;
}

/* ── Error banner ── */
.error-messages {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-left: 3px solid #ef4444;
    padding: .75rem 1rem;
    border-radius: .5rem;
    margin-bottom: 1.25rem;
}

.error-item {
    margin: 0;
    font-size: 0.875rem;
}

/* ── Form groups ── */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: .45rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #3C4A43;
}

/* input with icon */
.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: .875rem;
    color: #93A29B;
    pointer-events: none;
    display: flex;
    align-items: center;
    font-size: .9rem;
}

.input-wrap input {
    width: 100%;
    padding: .75rem 1rem .75rem 2.6rem;
    background: var(--brand-shell, #F5F7F6);
    border: 1px solid var(--brand-line, #E2E8E4);
    border-radius: .625rem;
    font-size: .9rem;
    color: var(--brand-ink, #1B2420);
    transition: border-color .18s, box-shadow .18s, background .18s;
}

.input-wrap input:focus {
    outline: none;
    background: #fff;
    border-color: var(--brand-muted, #6B7A73);
    box-shadow: 0 0 0 3px rgba(107,114,128,.12);
}

/* password toggle */
.toggle-password {
    position: absolute;
    right: .875rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #93A29B;
    padding: 0;
    display: flex;
    align-items: center;
    font-size: .9rem;
    transition: color .15s;
}

.toggle-password:hover {
    color: #4b5563;
}

/* ── Label row ── */
.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .45rem;
}

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

.forgot-link {
    font-size: 0.8rem;
    color: var(--brand-muted, #6B7A73);
    text-decoration: none;
    transition: color .15s;
}

.forgot-link:hover {
    color: var(--brand-header, #0B5C31);
    text-decoration: underline;
}

/* ── Remember me ── */
.remember {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 0;
}

.remember input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1rem;
    height: 1rem;
    border: 1.5px solid #d1d5db;
    border-radius: .25rem;
    background: #fff;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: border-color .15s, background .15s;
}

.remember input[type="checkbox"]:checked {
    background: var(--brand-action, #BE4F1A);
    border-color: var(--brand-action, #BE4F1A);
}

.remember input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: .125rem;
    left: .275rem;
    width: .35rem;
    height: .55rem;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

.remember label {
    font-size: 0.8rem;
    color: #4b5563;
    cursor: pointer;
    margin-bottom: 0;
}

/* ── Submit button ── */
.btn-submit {
    width: 100%;
    margin-top: 1.5rem;
    padding: .875rem;
    background: var(--brand-action, #BE4F1A);
    color: #fff;
    border: none;
    border-radius: .625rem;
    cursor: pointer;
    font-size: .9375rem;
    font-weight: 600;
    letter-spacing: .01em;
    transition: background .18s, box-shadow .18s, transform .1s;
    box-shadow: 0 1px 3px rgba(0,0,0,.15), 0 4px 12px rgba(27,36,32,.12);
}

.btn-submit:hover:not(:disabled) {
    background: var(--brand-action-hover, #9A3F14);
    box-shadow: 0 2px 8px rgba(0,0,0,.18), 0 6px 20px rgba(27,36,32,.18);
    transform: translateY(-1px);
}

.btn-submit:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0,0,0,.12);
}

.btn-submit:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* ── Loading overlay ── */
.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,.7);
    backdrop-filter: blur(3px);
    z-index: 999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: .75rem;
}

.loading-overlay .spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--brand-line, #E2E8E4);
    border-top-color: var(--brand-action, #BE4F1A);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.loading-overlay .loading-text {
    font-size: .85rem;
    color: #4b5563;
    font-weight: 500;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Footer ── */
.footer {
    text-align: center;
    color: #93A29B;
    font-size: 0.75rem;
    margin-top: 2rem;
}

/* ── Responsive ── */
@media (min-width: 1024px) {
    .login-wrapper {
        flex-direction: row;
    }

    .login-image {
        display: flex;
    }

    .login-form-container {
        padding: 4rem;
        flex: 0 0 440px;
    }
}
