@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

@font-face {
    font-family: 'ITC Benguiat';
    src: url('fonts/ITCBenguiat-Regular.woff2') format('woff2'),
         url('fonts/ITCBenguiat-Regular.woff') format('woff'),
         url('fonts/ITCBenguiat-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'ITC Benguiat Bold Condensed';
    src: url('fonts/ITCBenguiat-BoldCondensed.woff2') format('woff2'),
         url('fonts/ITCBenguiat-BoldCondensed.woff') format('woff'),
         url('fonts/ITCBenguiat-BoldCondensed.ttf') format('truetype');
}

:root {
    --primary-color: #001a47;
    --primary-soft: #1e4ea1;
    --surface-color: #ffffff;
    --field-bg: #f6f9f5;
    --field-border: #d8e3d4;
    --text-main: #102033;
    --text-muted: #5b6b81;
    --error-color: #b42318;
    --success-color: #067647;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 12%, rgba(40, 96, 204, 0.32), transparent 28%),
        linear-gradient(145deg, #061231 0%, #082257 46%, #001a47 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    color: var(--text-main);
}

.auth-shell {
    width: 980px;
    max-width: 100%;
    min-height: 540px;
    background: var(--surface-color);
    border-radius: 12px;
    overflow: hidden;
    display: grid !important;
    grid-template-columns: minmax(300px, 0.39fr) minmax(500px, 0.61fr);
    padding: 0 !important;
    margin: 0 auto;
    position: relative;
    box-shadow:
        0 28px 60px rgba(0, 0, 0, 0.38),
        0 10px 24px rgba(0, 0, 0, 0.22);
}

.auth-intro {
    background:
        linear-gradient(145deg, rgba(39, 99, 196, 0.9), rgba(0, 26, 71, 0.96)),
        linear-gradient(145deg, #2a64c9 0%, #001a47 100%);
    color: #ffffff;
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 36px;
    position: relative;
}

.auth-intro::before,
.auth-intro::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.auth-intro::before {
    width: 390px;
    height: 390px;
    left: -140px;
    top: -92px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.34), rgba(66, 142, 255, 0.1));
    transform: rotate(45deg);
    border-radius: 34px;
    box-shadow:
        84px 84px 0 rgba(100, 160, 255, 0.18),
        142px 142px 0 rgba(0, 26, 71, 0.12);
}

.auth-intro::after {
    width: 320px;
    height: 320px;
    left: -122px;
    top: 150px;
    background: linear-gradient(135deg, rgba(0, 26, 71, 0.42), rgba(255, 255, 255, 0.08));
    transform: rotate(45deg);
    border-radius: 24px;
    pointer-events: none;
}

.auth-intro > * {
    position: relative;
    z-index: 1;
}

.intro-brand {
    opacity: 0.88;
    transform: none;
}

.intro-kicker {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
    color: #ffd86b;
    margin-bottom: 12px;
}

.auth-intro h1 {
    font-family: 'ITC Benguiat Bold Condensed', serif;
    font-size: 32px;
    line-height: 1;
    margin: 0 0 8px;
}

.intro-copy {
    max-width: 300px;
    color: rgba(255, 255, 255, 0.84);
    font-size: 14px;
    line-height: 1.65;
}

.auth-panel {
    padding: 40px 62px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 540px;
    background: #ffffff;
}

.auth-tabs {
    width: 168px;
    max-width: none;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    position: absolute;
    z-index: 5;
    top: 178px;
    left: calc(39% - 154px);
}

.auth-tab {
    min-height: 54px;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    color: rgba(255, 255, 255, 0.82);
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    box-shadow: none;
    padding: 10px 18px;
    transform: none;
}

.auth-tab:hover {
    color: #ffffff;
    background: transparent !important;
    transform: none;
}

.auth-shell:not(.active) .login-tab,
.auth-shell.active .register-tab {
    background: #ffffff !important;
    color: var(--primary-color);
    border-radius: 999px;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.16);
    position: relative;
    transform: translateX(34px);
}

.auth-shell:not(.active) .login-tab:hover,
.auth-shell.active .register-tab:hover {
    color: var(--primary-color);
    background: #ffffff !important;
    transform: translateX(34px);
}

.auth-tab {
    position: relative;
    z-index: 1;
}

.form-container {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    opacity: 1 !important;
    height: auto !important;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: 1;
    min-height: 0;
}

.sign-in {
    justify-content: center;
}

.sign-up {
    justify-content: flex-start;
}

.auth-shell:not(.active) .sign-up,
.auth-shell.active .sign-in {
    display: none;
}

.signup-form,
.sign-in form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.sign-in form {
    min-height: auto;
}

.signup-form {
    max-height: 462px;
    overflow-y: auto;
    padding: 2px 6px 10px 0;
}

.signup-form::-webkit-scrollbar {
    width: 6px;
}

.signup-form::-webkit-scrollbar-thumb {
    background: rgba(0, 26, 71, 0.24);
    border-radius: 999px;
}

.auth-logo {
    width: 96px;
    max-width: 66%;
    height: auto;
    margin: 0 auto 14px;
    display: block;
    filter: drop-shadow(0 8px 18px rgba(0, 26, 71, 0.16));
}

.auth-avatar {
    width: 76px;
    height: 76px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: linear-gradient(145deg, #6fa2ff, #001a47);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    box-shadow:
        0 12px 24px rgba(0, 26, 71, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.form-title {
    margin: 0 0 34px;
    color: var(--primary-color);
    text-align: center;
    font-size: 24px;
    font-weight: 800;
    text-transform: uppercase;
}

.form-alert {
    width: 100%;
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

.form-alert.error {
    background: #fef3f2;
    color: var(--error-color);
    border: 1px solid #fecdca;
}

.form-alert.success {
    background: #ecfdf3;
    color: var(--success-color);
    border: 1px solid #abefc6;
}

input,
select,
.textbox {
    width: 100%;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #cfd8e3;
    margin: 0 0 18px;
    padding: 11px 8px;
    font-size: 15px;
    border-radius: 0;
    outline: none;
    color: var(--primary-color);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    appearance: none;
    min-height: 46px;
    line-height: 1.25;
}

input:focus,
select:focus,
.textbox:focus {
    border-color: var(--primary-soft);
    background: transparent;
    box-shadow: none;
}

input::placeholder {
    color: #6e8097;
}

#account_type,
select.textbox,
select {
    padding-right: 42px;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--primary-color) 50%),
        linear-gradient(135deg, var(--primary-color) 50%, transparent 50%);
    background-position:
        calc(100% - 20px) 50%,
        calc(100% - 14px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.password-field,
.sign-in .input-group {
    position: relative;
    width: 100%;
}

.password-input {
    padding-left: 8px;
    padding-right: 44px;
}

#togglePassword,
.sign-in .input-group i#toggleLoginPassword {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--primary-color);
    font-size: 16px;
    z-index: 3;
}

#togglePassword {
    left: auto;
    right: 15px;
}

.business-group {
    width: 100%;
}

.business-hidden {
    display: none;
}

.business-visible {
    display: block;
}

.birthday-wrapper {
    width: 100%;
    position: relative;
}

.birthday-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    padding: 13px 15px;
    color: var(--primary-color);
    font-size: 14px;
    pointer-events: none;
    z-index: 2;
}

#birthday {
    position: relative;
    z-index: 1;
    color: transparent;
    caret-color: transparent;
}

#birthday:placeholder-shown {
    color: var(--primary-color);
    caret-color: var(--primary-color);
}

#birthday::-webkit-calendar-picker-indicator {
    opacity: 1;
    cursor: pointer;
}

.permit-wrapper {
    width: 100%;
    margin-bottom: 12px;
}

.permit-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.permit-wrapper .permit-button {
    background: var(--field-bg);
    border: 1px solid var(--field-border);
    padding: 13px 15px;
    border-radius: 12px;
    cursor: pointer;
    width: 100%;
    font-size: 14px;
    color: var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    min-width: 0;
    height: auto;
    margin: 0;
    transform: none;
}

.permit-wrapper .permit-button span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.permit-wrapper .permit-button:hover {
    border-color: #7ea2df;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(30, 78, 161, 0.08);
    transform: none;
}

.permit-wrapper .permit-camera-button {
    min-width: 132px;
}

.permit-help {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.password-help {
    display: block;
    margin: -8px 0 12px;
    font-size: 11px;
    line-height: 1.35;
    color: var(--text-muted);
}

.permit-status {
    display: block;
    margin-top: 7px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.permit-status.error {
    color: var(--error-color);
}

.permit-status.success {
    color: var(--success-color);
}

.sign-in .input-group {
    margin-bottom: 20px;
}

.sign-in .input-group i.fa-envelope,
.sign-in .input-group i.fa-lock {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #637489;
}

.sign-in .input-group input {
    padding-left: 44px;
    padding-right: 44px;
    height: 48px;
    margin-bottom: 0;
}

.sign-in .options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 12px;
    margin-top: -6px;
    margin-bottom: 28px;
}

.sign-in .options-row label {
    display: none;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--primary-color);
    cursor: pointer;
}

.sign-in .options-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-height: 16px;
    margin: 0;
    padding: 0;
    accent-color: var(--primary-color);
    appearance: auto;
}

.sign-in .options-row a {
    text-decoration: none;
    color: var(--primary-color);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

button {
    background: linear-gradient(135deg, #001a47, #1e4ea1);
    color: #fff;
    padding: 10px 30px;
    border: none;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

button:hover {
    background: linear-gradient(135deg, #032764, #2a64c9);
    transform: translateY(-1px);
}

.sign-up form button,
.sign-in button {
    align-self: center;
    min-width: 150px;
    height: 42px;
    margin-top: 8px;
}

.sign-up form button {
    margin-top: 8px;
}

@media (max-width: 900px) {
    body {
        padding: 12px;
        align-items: stretch;
    }

    .auth-shell {
        min-height: 100vh;
        grid-template-columns: 1fr;
        border-radius: 20px;
    }

    .auth-intro {
        min-height: 190px;
        padding: 28px 24px;
        gap: 20px;
        background:
            radial-gradient(circle at 26% 60%, rgba(255, 255, 255, 0.18), transparent 28%),
            radial-gradient(circle at 12% 18%, rgba(255, 216, 107, 0.14), transparent 26%),
            linear-gradient(145deg, #00143b 0%, #083174 52%, #2a64c9 100%);
    }

    .auth-intro::before,
    .auth-intro::after {
        opacity: 0.55;
        transform: rotate(45deg) scale(0.72);
    }

    .auth-intro h1 {
        font-size: 34px;
    }

    .intro-copy {
        max-width: 78%;
        font-size: 14px;
        line-height: 1.5;
    }

    .intro-brand {
        opacity: 1;
        transform: none;
    }

    .auth-panel {
        min-height: auto;
        padding: 22px 16px 0;
    }

    .auth-tabs {
        position: static;
        width: 100%;
        max-width: 420px;
        margin: 0 auto 22px;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        padding: 6px;
        background: #eef3f8;
        border: 1px solid #dce5ee;
        border-radius: 14px;
    }

    .auth-tab {
        min-height: 42px;
        color: var(--text-muted);
        border-radius: 10px;
    }

    .auth-tab:hover {
        color: var(--primary-color);
    }

    .form-container {
        max-width: 100%;
    }

    .sign-in {
        justify-content: flex-start;
    }

    .sign-in form {
        min-height: auto;
    }

    .sign-in button {
        align-self: center;
        min-width: 170px;
        height: 46px;
        margin-top: 8px;
    }

    .signup-form {
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
    }
}

@media (max-width: 520px) {
    body {
        padding: 0;
    }

    .auth-shell {
        border-radius: 0;
    }

    .auth-intro {
        min-height: 164px;
        padding: 22px 18px;
        background:
            radial-gradient(circle at 26% 60%, rgba(255, 255, 255, 0.18), transparent 28%),
            radial-gradient(circle at 12% 18%, rgba(255, 216, 107, 0.14), transparent 26%),
            linear-gradient(145deg, #00143b 0%, #083174 52%, #2a64c9 100%);
    }

    .intro-kicker {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .auth-intro h1 {
        font-size: 30px;
    }

    .intro-copy {
        max-width: 82%;
        font-size: 13px;
    }

    .sign-in .options-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .sign-in .options-row label {
        display: flex;
    }

    .permit-actions {
        grid-template-columns: 1fr;
    }

    .permit-wrapper .permit-camera-button {
        min-width: 0;
    }

}
