@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap");

:root {
    --navy: #14213d;
    --navy-soft: #1d3155;
    --blue: #246fb5;
    --blue-dark: #19598f;
    --blue-pale: #edf6fd;
    --pink: #e83e78;
    --pink-pale: #fff1f6;
    --green: #0e8a68;
    --surface: #ffffff;
    --page: #f3f7fb;
    --text: #182235;
    --muted: #68758a;
    --border: #dce5ef;
    --border-strong: #c4d2e1;
    --danger: #c93d52;
    --shadow: 0 24px 65px rgba(29, 49, 85, 0.14);
    --font-body: "Inter", sans-serif;
    --font-heading: "Manrope", sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    padding: 32px 40px 32px calc(45vw + 40px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--page);
    color: var(--text);
    font-family: var(--font-body);
}

body.register-mode {
    align-items: flex-start;
}

button,
input,
select {
    font: inherit;
}

.hidden {
    display: none !important;
}

.auth-brand-panel {
    width: 45vw;
    min-height: 100vh;
    position: fixed;
    inset: 0 auto 0 0;
    display: flex;
    align-items: flex-end;
    padding: 56px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(14, 30, 55, 0.16), rgba(14, 30, 55, 0.9)),
        url("/uploads/hospital_building%20(1).jpg") center / cover no-repeat;
    color: #ffffff;
}

.brand-panel-content {
    width: min(520px, 100%);
    position: relative;
    z-index: 1;
}

.brand-panel-logo {
    width: 240px;
    height: 86px;
    margin-bottom: 34px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #ffffff;
    object-fit: contain;
}

.brand-eyebrow,
.form-eyebrow {
    margin-bottom: 10px;
    color: #9fd5ff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-brand-panel h1 {
    max-width: 480px;
    font-family: var(--font-heading);
    font-size: clamp(34px, 4vw, 58px);
    line-height: 1.08;
}

.brand-copy {
    max-width: 500px;
    margin-top: 18px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    line-height: 1.75;
}

.brand-trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.brand-trust-row span {
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
}

.container {
    width: min(100%, 1120px);
    padding: 42px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

#loginForm {
    max-width: 520px;
}

#registerForm {
    margin: 0 auto;
}

.logo {
    width: 220px;
    height: 128px;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

.form-eyebrow {
    color: var(--blue);
}

h2 {
    color: var(--navy);
    font-family: var(--font-heading);
    font-size: 30px;
    line-height: 1.2;
}

.form-subtitle {
    margin: 9px 0 30px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
}

form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

#loginForm form {
    grid-template-columns: 1fr;
}

.input-group {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label,
.input-group lable {
    color: #334155;
    font-size: 12px;
    font-weight: 700;
}

.input-group input,
.input-group select {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    outline: none;
    background: #ffffff;
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.input-group input::placeholder {
    color: #98a5b7;
}

.input-group input:hover,
.input-group select:hover {
    border-color: #9db2c8;
}

.input-group input:focus,
.input-group select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(36, 111, 181, 0.13);
}

.input-group input[type="file"] {
    min-height: 48px;
    padding: 7px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 12px;
}

.input-group input[type="file"]::file-selector-button {
    min-height: 32px;
    margin-right: 10px;
    padding: 6px 11px;
    border: 1px solid #bfd0e2;
    border-radius: 5px;
    background: #ffffff;
    color: var(--blue-dark);
    font-weight: 700;
    cursor: pointer;
}

.btn {
    min-height: 48px;
    padding: 11px 18px;
    border: 1px solid var(--blue);
    border-radius: 6px;
    background: var(--blue);
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(36, 111, 181, 0.2);
    transition: background-color 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    border-color: var(--blue-dark);
    background: var(--blue-dark);
    transform: translateY(-1px);
    box-shadow: 0 12px 25px rgba(36, 111, 181, 0.25);
}

.btn:focus-visible,
.switch-text a:focus-visible {
    outline: 3px solid rgba(36, 111, 181, 0.22);
    outline-offset: 3px;
}

.btn.small {
    min-height: 42px;
    padding: 9px 14px;
    background: #ffffff;
    color: var(--blue-dark);
    box-shadow: none;
}

.btn.small:hover {
    background: var(--blue-pale);
}

form > .btn {
    grid-column: 1 / -1;
    margin-top: 8px;
}

.switch-text {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    text-align: center;
    font-size: 13px;
}

.switch-text a {
    color: var(--blue-dark);
    font-weight: 800;
    text-decoration: none;
}

.switch-text a:hover {
    text-decoration: underline;
}

.full-width {
    grid-column: 1 / -1;
}

h3.full-width {
    margin-top: 18px;
    padding: 18px 0 10px;
    border-top: 1px solid var(--border);
    color: var(--navy);
    font-family: var(--font-heading);
    font-size: 17px;
}

#hospitalFields:not(.hidden),
#ambulanceFields:not(.hidden),
#labFields:not(.hidden),
#insuranceFields:not(.hidden),
#medicineFields:not(.hidden),
#equipmentFields:not(.hidden) {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 12px;
    padding: 24px;
    border: 1px solid #cfe0ef;
    border-radius: 8px;
    background: #f8fbfe;
}

#hospitalFields:not(.hidden) h3:first-child,
#ambulanceFields:not(.hidden) h3:first-child,
#labFields:not(.hidden) h3:first-child,
#insuranceFields:not(.hidden) h3:first-child,
#medicineFields:not(.hidden) h3:first-child,
#equipmentFields:not(.hidden) h3:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.checkbox-grid label {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.checkbox-grid label:hover {
    border-color: #9fc4e3;
    background: var(--blue-pale);
}

.checkbox-grid input[type="checkbox"] {
    width: 16px;
    min-height: 16px;
    accent-color: var(--blue);
}

.dynamic-box {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 14px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #ffffff;
}

.remove-btn {
    grid-column: 1 / -1;
    border-color: #edb8c1;
    background: #ffffff;
    color: var(--danger);
}

.remove-btn:hover {
    border-color: var(--danger);
    background: #fff3f5;
    color: #a72b40;
}

::-webkit-scrollbar {
    width: 9px;
}

::-webkit-scrollbar-track {
    background: #edf2f7;
}

::-webkit-scrollbar-thumb {
    border: 2px solid #edf2f7;
    border-radius: 8px;
    background: #9aafc4;
}

@media (max-width: 1180px) {
    body {
        padding-left: calc(38vw + 28px);
        padding-right: 28px;
    }

    .auth-brand-panel {
        width: 38vw;
        padding: 36px;
    }

    .brand-trust-row {
        display: none;
    }

    .container {
        padding: 34px;
    }
}

@media (max-width: 900px) {
    body,
    body.register-mode {
        padding: 24px;
        align-items: flex-start;
    }

    .auth-brand-panel {
        width: 100%;
        min-height: 250px;
        position: relative;
        inset: auto;
        align-items: flex-end;
        margin-bottom: 24px;
        padding: 28px;
        border-radius: 8px;
    }

    body {
        display: block;
    }

    .brand-panel-logo,
    .brand-copy,
    .brand-trust-row {
        display: none;
    }

    .auth-brand-panel h1 {
        max-width: 600px;
        font-size: 34px;
    }

    .container,
    #loginForm {
        max-width: none;
    }
}

@media (max-width: 700px) {
    body,
    body.register-mode {
        padding: 14px;
    }

    .auth-brand-panel {
        min-height: 200px;
        margin-bottom: 14px;
        padding: 22px;
    }

    .auth-brand-panel h1 {
        font-size: 27px;
    }

    .container {
        padding: 24px 18px;
    }

    .logo {
        width: 175px;
        margin-bottom: 24px;
    }

    h2 {
        font-size: 25px;
    }

    form,
    #registerForm form,
    #hospitalFields:not(.hidden),
    #ambulanceFields:not(.hidden),
    #labFields:not(.hidden),
    #insuranceFields:not(.hidden),
    #medicineFields:not(.hidden),
    #equipmentFields:not(.hidden),
    .dynamic-box {
        grid-template-columns: 1fr;
    }

    #hospitalFields:not(.hidden),
    #ambulanceFields:not(.hidden),
    #labFields:not(.hidden),
    #insuranceFields:not(.hidden),
    #medicineFields:not(.hidden),
    #equipmentFields:not(.hidden) {
        padding: 18px 14px;
    }

    .full-width,
    form > .btn,
    .remove-btn {
        grid-column: 1;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }
}
