/* assets/css/login.css */

body.login-body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    height: 100vh;
    background-color: var(--bg-light);
    overflow: hidden;
}

/* Left Brand Panel */
.brand-panel {
    flex: 1;
    background-color: var(--primary-green);
    color: white;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.brand-logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* The mark is an <a> back to the public page. As an anchor it would
   otherwise pick up the default underline and link colour, which would
   look wrong on the green panel. */
a.brand-logo-container {
    color: inherit;
    text-decoration: none;
    align-self: flex-start;
    border-radius: 10px;
    padding: 4px;
    margin: -4px;
    transition: opacity 0.18s ease;
}

a.brand-logo-container:hover {
    opacity: 0.82;
}

a.brand-logo-container:focus-visible {
    outline: 2px solid var(--accent-yellow);
    outline-offset: 2px;
}

.brand-logo-icon {
    width: 44px;
    height: 44px;
    background-color: var(--accent-yellow);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.brand-text h1 {
    font-size: 42px;
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 20px;
}

.brand-text p {
    font-size: 16px;
    line-height: 1.5;
    color: #e8f5e9;
    max-width: 480px;
}

/* Right Form Panel */
.form-panel {
    width: 550px;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: #ffffff;
    box-shadow: -4px 0 20px rgba(0,0,0,0.02);
}

/* The split screen is locked to the viewport height, which clips a tall
   form (register) on a short window. Below this height, drop the fixed
   split and let the page scroll - the same thing the narrow-width rule
   below already does. */
@media (max-height: 780px) {
    body.login-body {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }

    .form-panel {
        justify-content: flex-start;
    }
}

.form-header h2 {
    font-size: 28px;
    margin: 0 0 8px 0;
    color: var(--text-main);
}

.form-header p {
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* Role Selector Tabs */
.role-tabs {
    display: flex;
    background: #f1f3f1;
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.role-tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    border: none;
    background: transparent;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.role-tab.active {
    background: white;
    color: var(--primary-green);
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* Input Fields */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--text-main);
}

.input-field-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-field-wrapper input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.input-field-wrapper input:focus {
    border-color: var(--primary-green);
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
}

/* Show/hide password control */
.input-field-wrapper.has-password-toggle input {
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    right: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.password-toggle svg {
    width: 18px;
    height: 18px;
}

.password-toggle:hover {
    color: var(--primary-green);
    background: #f1f5f1;
}

.password-toggle:focus-visible {
    outline: 2px solid var(--primary-green);
    outline-offset: 1px;
}

/* Form Options & Button */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    font-size: 14px;
}

.form-options a {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 600;
}

.btn-submit {
    width: 100%;
    position: static;
    background-color: var(--accent-yellow);
    color: #ffffff;
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-submit:hover {
    opacity: 0.9;
}

/* =====================================================
   Responsive breakpoints
   ===================================================== */

@media (max-width: 1100px) {
    .brand-panel,
    .form-panel {
        padding: 40px;
    }

    .form-panel {
        width: 440px;
    }

    .brand-text h1 {
        font-size: 34px;
    }
}

/* Stack the brand panel above the form and let the page scroll —
   the fixed 100vh split only works side by side */
@media (max-width: 860px) {
    body.login-body {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow: auto;
    }

    .brand-panel {
        flex: none;
        padding: 30px 24px;
        gap: 18px;
    }

    .brand-text h1 {
        font-size: 26px;
        margin-bottom: 12px;
    }

    .brand-text p {
        font-size: 14px;
        max-width: none;
    }

    .form-panel {
        width: 100%;
        padding: 30px 24px;
        box-shadow: none;
    }
}

@media (max-width: 480px) {
    .brand-panel {
        padding: 24px 18px;
    }

    .brand-text h1 {
        font-size: 22px;
    }

    .form-panel {
        padding: 24px 18px;
    }

    .form-header h2 {
        font-size: 22px;
    }

    .form-header p {
        margin-bottom: 22px;
    }

    .role-tab {
        padding: 9px 4px;
        font-size: 13px;
    }

    .form-options {
        flex-wrap: wrap;
        gap: 10px;
    }
}
/* Unconfirmed-email prompt on the sign-in form */
.verify-banner {
    background: #fff8e6;
    border: 1px solid #ffe0a3;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 18px;
}

.verify-banner p {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: #8a6100;
    line-height: 1.5;
}

.verify-banner button {
    width: 100%;
    border: none;
    background: var(--primary-green);
    color: #fff;
    border-radius: 8px;
    padding: 10px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}

.verify-banner button:hover { background: #24652a; }
.verify-banner button:disabled { opacity: 0.6; cursor: not-allowed; }

/* Two short fields side by side, so the sign-up form fits a laptop
   screen instead of running off the bottom. Stacks again when narrow. */
.input-row {
    display: flex;
    gap: 14px;
}

.input-row .input-group {
    flex: 1;
    min-width: 0;
}

@media (max-width: 520px) {
    .input-row {
        display: block;
    }
}

/* The sign-up form has more fields than sign-in, so it gets slightly
   tighter spacing to clear a 768px-tall laptop screen. */
.register-compact .input-group { margin-bottom: 15px; }
.register-compact .form-header { margin-bottom: 0; }
.register-compact .form-header p { margin-bottom: 18px; }
.register-compact .role-tabs { margin-bottom: 20px; }
