:root {
    --color-bg: #f5f7fb;
    --color-surface: #ffffff;
    --color-text: #1f2937;
    --color-muted: #6b7280;
    --color-accent: #2563eb;
    --radius: 12px;
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 8px 18px rgba(0, 0, 0, 0.06);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family:
        system-ui,
        -apple-system,
        Segoe UI,
        Roboto,
        Helvetica,
        Arial,
        "Noto Sans",
        "Apple Color Emoji",
        "Segoe UI Emoji",
        sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.auth-page {
    min-height: 100vh;
    max-width: 100%;
    overflow-x: hidden;
}

.auth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    background: #ffffff;
    min-width: 0;
    max-width: 100%;
}

.auth-card {
    background: var(--color-surface);
    width: 100%;
    max-width: min(660px, 100%);
    border-radius: var(--radius);
    padding: 32px;
    min-width: 0;
    box-sizing: border-box;
}

.auth-header {
    margin-bottom: 24px;
    text-align: center;
}

.auth-title {
    margin: 0 0 8px 0;
    font-weight: 600;
    font-size: 1.1rem;
}

.auth-subtitle {
    margin: 0;
    color: var(--color-muted);
    font-weight: 500;
    font-size: 0.95rem;
}

.auth-logo {
    height: 100px;
    width: auto;
    display: block;
    margin: 0 auto 12px;
}

.form-field {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-row {
    display: grid;
    gap: 12px;
}

.form-row--two-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-row--phone {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
}

.form-row--city-state {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.input-control {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    appearance: none;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.95rem;
    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.input-control:focus {
    outline: none;
    background: #fff;
    border-color: #952e48;
    box-shadow: 0 0 0 3px #7f1d1d;
}

.form-field--float {
    position: relative;
}

.input-control--float {
    padding: 16px 14px 10px 14px;
}

.input-control--select {
    min-height: 46px;
}

.input-control--file {
    padding: 10px 12px;
    background: #ffffff;
}

.input-control--file::file-selector-button {
    background: #952e48;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    margin-right: 12px;
    cursor: pointer;
}

.float-label {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-muted);
    background: transparent;
    padding: 0 4px;
    pointer-events: none;
    transition: all 0.18s ease;
}

.input-control--float:focus + .float-label,
.input-control--float:not(:placeholder-shown) + .float-label {
    top: -8px;
    background: var(--color-surface);
    font-size: 0.78rem;
    color: #000000;
}

.input-has-suffix {
    padding-right: 44px;
}

.input-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--color-muted);
    cursor: pointer;
    font-weight: 700;
}

.input-toggle:focus {
    outline: none;
    color: var(--color-accent);
}

.btn-primary-register {
    display: inline-block;
    width: 100%;
    background: #952e48;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 16px;
    font-weight: 700;
    letter-spacing: 0.2px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition:
        transform 0.05s ease,
        filter 0.2s ease,
        box-shadow 0.2s ease;
}

.btn-primary-register:disabled {
    cursor: not-allowed;
    opacity: 0.75;
    filter: grayscale(0.1);
}

.btn-secondary-register {
    display: inline-block;
    width: 100%;
    background: #ffffff;
    color: #952e48;
    border: 1px solid #952e48;
    border-radius: 10px;
    padding: 12px 16px;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-decoration: none;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition:
        transform 0.05s ease,
        filter 0.2s ease,
        box-shadow 0.2s ease;
}

.caps-hint {
    display: none;
    color: var(--color-muted);
    font-size: 0.8rem;
    margin-top: 6px;
}

.stepper {
    display: flex;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 8px 0;
    row-gap: 10px;
}

.stepper-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-muted);
    font-weight: 600;
    min-width: 0;
}

.stepper-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #d1d5db;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    background: #ffffff;
}

.stepper-label {
    font-size: 0.88rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.stepper-divider {
    flex: 1 1 12px;
    min-width: 8px;
    border-top: 1px solid #d1d5db;
    margin: 0 6px;
}

.stepper-item.is-active,
.stepper-item.is-completed {
    color: #952e48;
}

.stepper-item.is-active .stepper-number,
.stepper-item.is-completed .stepper-number {
    border-color: #952e48;
    background: #952e48;
    color: #ffffff;
}

.form-step {
    display: none;
}

.form-step.is-active {
    display: block;
}

.step-description {
    margin: 0 0 14px;
    color: #4b5563;
    font-size: 0.92rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.help-text {
    display: block;
    margin-top: 8px;
    color: #6b7280;
    font-size: 0.82rem;
}

.verification-help-text {
    margin-bottom: 14px;
}

.choices {
    margin-bottom: 0;
    max-width: 100%;
    position: relative;
    z-index: 5;
}

.choices[data-type*="select-one"] {
    max-width: 100%;
}

.choices.is-open {
    z-index: 10050;
}

.choices__inner {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    min-height: 46px;
    padding: 10px 14px;
    font-size: 0.95rem;
}

.choices.is-focused .choices__inner {
    outline: none;
    background: #fff;
    border-color: #952e48;
    box-shadow: 0 0 0 3px #7f1d1d;
}

.choices.is-disabled .choices__inner {
    background: #f3f4f6;
}

.choices-error {
    border-color: #ef4444 !important;
    box-shadow: none !important;
}

.choices__list--single {
    padding: 0;
}

.choices__list--dropdown,
.choices__list[aria-expanded] {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-top: 6px;
    z-index: 10051;
}

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.95rem;
    margin-bottom: 12px;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-danger {
    background: #fef2f2;
    color: #7f1d1d;
    border: 1px solid #fecaca;
}

.error-text {
    color: #dc2626;
}

.error-text:empty {
    display: none;
}

.form-field--submit {
    margin-top: 8px;
}

.form-field--actions {
    margin-top: 4px;
}

.form-field--actions-inline {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.privacy-consent {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px;
}

.privacy-consent__row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.privacy-consent__checkbox {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    accent-color: #952e48;
}

.privacy-consent__label {
    margin: 0;
    color: #374151;
    font-size: 0.92rem;
}

.privacy-consent__documents {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
}

.privacy-consent__documents-title {
    color: #952e48;
    font-size: 0.9rem;
    font-weight: 600;
}

.privacy-consent__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    color: #952e48;
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.privacy-consent__link:hover,
.privacy-consent__link:focus {
    outline: none;
    color: #7f1d1d;
    text-decoration: none;
}

.privacy-consent__link-text {
    line-height: 1.2;
}

.privacy-consent__link-icon {
    font-size: 0.76rem;
    opacity: 0.72;
    transform: translateX(0);
    transition:
        transform 0.2s cubic-bezier(0.2, 0, 0, 1),
        opacity 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.privacy-consent__link:hover .privacy-consent__link-icon,
.privacy-consent__link:focus .privacy-consent__link-icon {
    opacity: 1;
    transform: translateX(3px);
}

.privacy-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.privacy-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.privacy-modal__dialog {
    position: relative;
    width: min(720px, 100%);
    max-height: calc(100vh - 40px);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.28);
    padding: 22px;
    overflow: hidden;
    z-index: 1;
}

.privacy-modal__close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: none;
    background: transparent;
    font-size: 1.6rem;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
}

.privacy-modal__title {
    margin: 0 28px 12px 0;
    color: #111827;
    font-size: 1rem;
    line-height: 1.4;
}

.privacy-modal__content {
    max-height: min(56vh, 460px);
    overflow-y: auto;
    padding-right: 6px;
    color: #374151;
    font-size: 0.92rem;
    line-height: 1.6;
}

.privacy-modal__content p {
    margin-top: 0;
    margin-bottom: 12px;
}

.privacy-modal__actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.privacy-modal__actions .btn-primary-register,
.privacy-modal__actions .btn-secondary-register {
    width: auto;
    min-width: 180px;
    margin: 0;
}

body.privacy-modal-open {
    overflow: hidden;
}

.alert-list {
    margin: 0;
    padding-left: 20px;
}

.auth-illustration {
    min-height: 100vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.auth-illustration--register-empresa {
    background-image: url("/images/salamanca.jpg");
}

.register-empresa-map-wrap {
    margin-bottom: 16px;
    min-width: 0;
    max-width: 100%;
    position: relative;
    z-index: 1;
    isolation: isolate;
}

.register-empresa-map-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

#companyLocationMap {
    height: 280px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #f3f4f6;
    position: relative;
    z-index: 0;
}

.register-empresa-map-hint {
    display: block;
    margin-top: 8px;
    color: #6b7280;
    font-size: 0.82rem;
}

.is-hidden {
    display: none;
}

@media (max-width: 992px) {
    .auth-grid {
        grid-template-columns: 1fr;
    }

    .auth-illustration {
        order: -1;
        min-height: 38vh;
    }

    .auth-panel {
        padding: 28px 20px;
    }

    .auth-card {
        padding: 24px;
    }

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

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

    .form-row--city-state {
        grid-template-columns: 1fr;
    }

    .form-field--actions-inline {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .auth-illustration {
        display: none;
    }

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

    .auth-panel {
        padding: 24px 16px;
    }

    .auth-card {
        padding: 20px 16px;
    }

    .stepper-divider {
        display: none;
    }

    .stepper {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px 10px;
        align-items: start;
    }

    .stepper-item {
        flex-wrap: wrap;
        align-items: center;
    }

    .stepper-label {
        font-size: 0.76rem;
    }

    .input-control--file {
        padding: 10px 8px;
    }

    .input-control--file::file-selector-button {
        display: block;
        width: 100%;
        margin-right: 0;
        margin-bottom: 8px;
    }

    #companyLocationMap {
        height: 220px;
    }

    .privacy-modal {
        padding: 14px;
    }

    .privacy-modal__dialog {
        max-height: calc(100vh - 28px);
        padding: 18px 14px;
    }

    .privacy-modal__actions {
        flex-direction: column;
    }

    .privacy-modal__actions .btn-primary-register,
    .privacy-modal__actions .btn-secondary-register {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 380px) {
    .stepper-label {
        display: none;
    }

    .stepper-item {
        justify-content: center;
    }
}
