:root {
    --bfp-maroon: #9b111e;
    --bfp-maroon-dark: #74101a;
    --bfp-maroon-light: #fff5f6;
    --bfp-gold: #e6b93f;
    --bfp-text: #202936;
    --bfp-muted: #667085;
    --bfp-border: #d8dee8;
    --bfp-background: #f5f7fa;
    --bfp-white: #ffffff;
    --bfp-danger: #b42318;
    --bfp-success: #027a48;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body.bfp-auth-page {
    min-height: 100vh;
    margin: 0;
    background: var(--bfp-background);
    color: var(--bfp-text);
    font-family: Arial, Helvetica, sans-serif;
}

.bfp-auth-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 35px 20px 20px;
}

.bfp-auth-card {
    width: 100%;
    max-width: 1180px;
    min-height: 690px;
    display: grid;
    grid-template-columns: 47% 53%;
    margin: auto;
    overflow: hidden;
    border: 1px solid #dde3ea;
    border-radius: 18px;
    background: var(--bfp-white);
    box-shadow: 0 10px 35px rgba(31, 41, 55, 0.07);
}

.bfp-auth-card.registration-card {
    max-width: 1280px;
    grid-template-columns: 38% 62%;
}

.bfp-brand-panel {
    position: relative;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 48px;
    border-bottom: 10px solid var(--bfp-maroon);
    background: #fbfcfd;
}

.bfp-brand-panel::before {
    content: "";
    position: absolute;
    top: 40px;
    left: -145px;
    width: 310px;
    height: 310px;
    border: 2px solid rgba(155, 17, 30, 0.04);
    border-radius: 50%;
}

.bfp-brand-watermark {
    position: absolute;
    top: 95px;
    left: -85px;
    width: 270px;
    opacity: 0.035;
    pointer-events: none;
}

.bfp-brand-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.bfp-logo-container {
    width: 145px;
    height: 145px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 28px;
}

.bfp-logo-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.bfp-agency-name {
    margin: 0;
    color: #252d3a;
    font-size: 19px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.bfp-title-line {
    width: 55px;
    height: 4px;
    margin: 17px auto;
    border-radius: 10px;
    background: var(--bfp-maroon);
}

.bfp-system-name {
    max-width: 470px;
    margin: 0 auto;
    color: var(--bfp-maroon);
    font-size: 32px;
    font-weight: 800;
    line-height: 1.25;
    text-transform: uppercase;
}

.bfp-system-code {
    display: inline-block;
    margin-top: 15px;
    padding: 7px 18px;
    border-radius: 4px;
    background: var(--bfp-maroon);
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.bfp-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 390px;
    margin: 30px auto 20px;
}

.bfp-divider::before,
.bfp-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #d9dee7;
}

.bfp-divider-icon {
    color: var(--bfp-maroon);
    font-size: 18px;
}

.bfp-description {
    max-width: 440px;
    margin: auto;
    color: #596579;
    font-size: 15px;
    line-height: 1.8;
}

.bfp-brand-illustration {
    position: relative;
    z-index: 2;
    min-height: 125px;
    margin: 28px -48px -48px;
    overflow: hidden;
    border-top: 1px solid #edf0f4;
    background:
        linear-gradient(to top, rgba(155, 17, 30, 0.05), transparent),
        repeating-linear-gradient(
            90deg,
            transparent 0,
            transparent 70px,
            rgba(155, 17, 30, 0.025) 71px,
            rgba(155, 17, 30, 0.025) 72px
        );
}

.bfp-brand-illustration::before {
    content: "BFP  •  FIRE STATION  •  RESCUE  •  PUBLIC SAFETY";
    position: absolute;
    bottom: 32px;
    left: 0;
    width: 100%;
    color: rgba(155, 17, 30, 0.10);
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 6px;
    text-align: center;
    white-space: nowrap;
}

.bfp-form-panel {
    display: flex;
    align-items: center;
    padding: 55px 65px;
    background: #ffffff;
}

.registration-card .bfp-form-panel {
    align-items: flex-start;
    padding: 40px 50px;
    overflow-y: auto;
}

.bfp-form-container {
    width: 100%;
}

.bfp-form-header {
    margin-bottom: 30px;
    text-align: center;
}

.bfp-form-title {
    margin: 0;
    color: var(--bfp-text);
    font-size: 32px;
    font-weight: 800;
}

.bfp-form-title-line {
    width: 58px;
    height: 4px;
    margin: 16px auto 17px;
    border-radius: 5px;
    background: var(--bfp-maroon);
}

.bfp-form-subtitle {
    margin: 0;
    color: var(--bfp-muted);
    font-size: 15px;
    line-height: 1.6;
}

.bfp-alert {
    margin-bottom: 22px;
    padding: 13px 15px;
    border-radius: 7px;
    font-size: 13px;
    line-height: 1.5;
}

.bfp-alert-danger {
    border: 1px solid #f3b7b9;
    background: #fff1f1;
    color: var(--bfp-danger);
}

.bfp-alert-success {
    border: 1px solid #a6e4c5;
    background: #ecfdf3;
    color: var(--bfp-success);
}

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

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

.bfp-field {
    margin-bottom: 20px;
}

.bfp-form-grid .bfp-field {
    margin-bottom: 0;
}

.bfp-label {
    display: block;
    margin-bottom: 8px;
    color: #303948;
    font-size: 13px;
    font-weight: 700;
}

.bfp-required {
    color: var(--bfp-maroon);
}

.bfp-input-wrapper {
    position: relative;
}

.bfp-input-icon {
    position: absolute;
    top: 50%;
    left: 16px;
    z-index: 2;
    color: #8a94a6;
    font-size: 15px;
    transform: translateY(-50%);
    pointer-events: none;
}

.bfp-input,
.bfp-select,
.bfp-textarea {
    width: 100%;
    border: 1px solid var(--bfp-border);
    border-radius: 7px;
    background: #ffffff;
    color: var(--bfp-text);
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bfp-input,
.bfp-select {
    height: 51px;
    padding: 10px 15px;
}

.bfp-input.with-icon,
.bfp-select.with-icon {
    padding-left: 45px;
}

.bfp-input.with-action {
    padding-right: 48px;
}

.bfp-textarea {
    min-height: 95px;
    padding: 13px 15px;
    resize: vertical;
}

.bfp-input:focus,
.bfp-select:focus,
.bfp-textarea:focus {
    outline: none;
    border-color: var(--bfp-maroon);
    box-shadow: 0 0 0 3px rgba(155, 17, 30, 0.09);
}

.bfp-input:disabled,
.bfp-select:disabled {
    background: #f2f4f7;
    cursor: not-allowed;
}

.bfp-password-toggle {
    position: absolute;
    top: 50%;
    right: 14px;
    z-index: 3;
    border: 0;
    padding: 5px;
    background: transparent;
    color: #7f8998;
    cursor: pointer;
    transform: translateY(-50%);
}

.bfp-field-error {
    display: block;
    margin-top: 6px;
    color: var(--bfp-danger);
    font-size: 12px;
}

.bfp-field-note {
    display: block;
    margin-top: 6px;
    color: #7b8493;
    font-size: 12px;
    line-height: 1.5;
}

.bfp-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 3px 0 25px;
}

.bfp-checkbox {
    display: inline-flex;
    align-items: center;
    margin: 0;
    color: #4f5b6d;
    font-size: 13px;
    cursor: pointer;
}

.bfp-checkbox input {
    width: 17px;
    height: 17px;
    margin-right: 8px;
    accent-color: var(--bfp-maroon);
}

.bfp-link {
    color: var(--bfp-maroon);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.bfp-link:hover {
    color: var(--bfp-maroon-dark);
    text-decoration: underline;
}

.bfp-primary-button,
.bfp-outline-button {
    min-height: 51px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border-radius: 7px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.3px;
    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.bfp-primary-button {
    width: 100%;
    border: 1px solid var(--bfp-maroon);
    background: var(--bfp-maroon);
    color: #ffffff;
}

.bfp-primary-button:hover {
    border-color: var(--bfp-maroon-dark);
    background: var(--bfp-maroon-dark);
    color: #ffffff;
}

.bfp-outline-button {
    border: 1px solid var(--bfp-maroon);
    background: #ffffff;
    color: var(--bfp-maroon);
}

.bfp-outline-button:hover {
    background: var(--bfp-maroon-light);
    color: var(--bfp-maroon-dark);
}

.bfp-secondary-divider {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 30px 0 23px;
    color: #7b8493;
    font-size: 14px;
}

.bfp-secondary-divider::before,
.bfp-secondary-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e1e5eb;
}

.bfp-account-action {
    text-align: center;
}

.bfp-account-action p {
    margin: 0 0 13px;
    color: #596579;
    font-size: 14px;
}

.bfp-section {
    margin-bottom: 27px;
    padding: 22px;
    border: 1px solid #e2e7ed;
    border-radius: 10px;
    background: #ffffff;
}

.bfp-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #ebeff3;
}

.bfp-section-number {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--bfp-maroon);
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
}

.bfp-section-title {
    margin: 0;
    color: #273142;
    font-size: 17px;
    font-weight: 800;
}

.bfp-section-description {
    margin: 4px 0 0;
    color: #778195;
    font-size: 12px;
}

.bfp-custom-station-box {
    display: none;
    margin-top: 18px;
    padding: 18px;
    border: 1px dashed #c9a3a8;
    border-radius: 8px;
    background: #fffafb;
}

.bfp-custom-station-box.is-visible {
    display: block;
}

.bfp-office-notice {
    margin-top: 14px;
    padding: 12px 14px;
    border-left: 4px solid var(--bfp-gold);
    background: #fffaf0;
    color: #5f5340;
    font-size: 12px;
    line-height: 1.6;
}

.bfp-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-top: 25px;
}

.bfp-form-actions .bfp-primary-button {
    width: auto;
    min-width: 220px;
}

.bfp-auth-footer {
    padding: 22px 15px 0;
    color: #687385;
    font-size: 12px;
    line-height: 1.7;
    text-align: center;
}

.bfp-auth-footer strong {
    color: #485466;
}

@media (max-width: 980px) {
    .bfp-auth-card,
    .bfp-auth-card.registration-card {
        max-width: 650px;
        grid-template-columns: 1fr;
    }

    .bfp-brand-panel {
        min-height: auto;
        padding: 35px;
    }

    .bfp-brand-illustration {
        display: none;
    }

    .bfp-description {
        display: none;
    }

    .bfp-logo-container {
        width: 105px;
        height: 105px;
        margin-bottom: 18px;
    }

    .bfp-system-name {
        font-size: 25px;
    }

    .bfp-form-panel,
    .registration-card .bfp-form-panel {
        padding: 40px 35px;
    }
}

@media (max-width: 650px) {
    .bfp-auth-wrapper {
        padding: 0;
    }

    .bfp-auth-card,
    .bfp-auth-card.registration-card {
        min-height: 100vh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .bfp-brand-panel {
        padding: 25px 20px;
        border-bottom-width: 5px;
    }

    .bfp-logo-container {
        width: 82px;
        height: 82px;
        margin-bottom: 12px;
    }

    .bfp-agency-name {
        font-size: 14px;
    }

    .bfp-title-line {
        margin: 11px auto;
    }

    .bfp-system-name {
        font-size: 20px;
    }

    .bfp-system-code {
        margin-top: 10px;
        padding: 5px 13px;
        font-size: 14px;
    }

    .bfp-divider {
        display: none;
    }

    .bfp-form-panel,
    .registration-card .bfp-form-panel {
        padding: 30px 20px;
    }

    .bfp-form-title {
        font-size: 25px;
    }

    .bfp-form-grid {
        grid-template-columns: 1fr;
    }

    .bfp-form-grid .full-width {
        grid-column: auto;
    }

    .bfp-section {
        padding: 17px;
    }

    .bfp-options,
    .bfp-form-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .bfp-form-actions .bfp-primary-button,
    .bfp-form-actions .bfp-outline-button {
        width: 100%;
    }
}
