:root {
    --primary: #1769ff;
    --primary-dark: #0b4fd4;
    --primary-soft: #eaf2ff;
    --text: #101828;
    --text-secondary: #667085;
    --border: #d8e0eb;
    --border-soft: #e4e9f1;
    --surface: #ffffff;
    --background: #f4f7fb;
    --success: #197044;
    --success-soft: #eef9f2;
    --danger: #a13737;
    --danger-soft: #fff1f1;
    --info: #275c9f;
    --info-soft: #f0f6ff;
    font-family: Poppins, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--background);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    min-width: 320px;
    background: var(--background);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--text);
    background: radial-gradient(circle at 50% 0, #ffffff 0, var(--background) 38rem);
    font-family: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

.page {
    min-height: 100vh;
    padding: 28px 18px 54px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.content {
    width: min(860px, 100%);
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 24px;
    box-shadow: 0 12px 34px rgba(15, 35, 70, 0.09);
    overflow: visible;
}

.header {
    color: var(--text);
}

.dm-domain-header {
    position: static;
    display: block;
    padding: 34px 30px 28px;
    border-radius: 24px 24px 0 0;
    border-bottom: 1px solid var(--border-soft);
    background: #fff;
    text-align: center;
}

.dm-domain-brand {
    display: flex;
    min-height: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.dm-domain-logo {
    display: block;
    width: 132px;
    height: 132px;
    max-width: 132px;
    margin: 0 auto;
    object-fit: contain;
    filter: drop-shadow(0 10px 18px rgba(15, 35, 70, 0.10));
}

.dm-domain-name {
    margin: 0;
    color: var(--primary);
    font-size: 27px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.7px;
    text-align: center;
}

.dm-domain-name sup {
    margin-left: 2px;
    color: var(--primary);
    font-size: 0.42em;
    vertical-align: super;
}

.dm-domain-header .header-copy {
    display: block;
}

.dm-domain-header h1 {
    margin: 15px 0 7px;
    color: var(--text);
    font-size: clamp(28px, 4vw, 38px);
    line-height: 1.1;
    letter-spacing: -1px;
    text-align: center;
}

.dm-domain-header .header-subtitle,
.dm-domain-header .header-copy > p,
.dm-domain-header > p {
    max-width: 600px;
    margin: 0 auto;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.5;
    text-align: center;
}

.content > form,
.registration-grid,
.profile-form {
    padding: 30px clamp(20px, 4vw, 38px) 38px;
}

form {
    display: grid;
    gap: 0;
}

label {
    display: block;
    margin: 0 0 7px;
    color: #273849;
    font-size: 14px;
    font-weight: 700;
}

form > label:not(:first-of-type),
.registration-grid > label:not(:first-of-type),
.profile-section > label:not(:first-of-type) {
    margin-top: 18px;
}

input,
select,
textarea {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px 12px;
    outline: none;
    background: #ffffff;
    color: #223142;
    font-size: 16px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(23, 105, 255, 0.12);
}

input::placeholder {
    color: #9aa5b1;
}

button,
.action-link.primary {
    min-height: 50px;
    border: 0;
    border-radius: 12px;
    padding: 13px 18px;
    background: linear-gradient(135deg, #287aff, var(--primary-dark));
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(23, 105, 255, 0.20);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

button {
    width: 100%;
    margin-top: 22px;
}

button:hover,
.action-link.primary:hover {
    background: linear-gradient(135deg, var(--primary), #0843b7);
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(23, 105, 255, 0.24);
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.button-secondary,
.action-link.secondary {
    border: 1px solid #bfd0e7;
    background: #ffffff;
    color: var(--primary-dark);
    box-shadow: none;
}

.button-secondary:hover,
.action-link.secondary:hover {
    border-color: #9bb9dd;
    background: #f7faff;
    color: var(--primary-dark);
    box-shadow: none;
}

.action-link {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    padding: 12px 18px;
    font-weight: 800;
    text-decoration: none;
}

.required-mark {
    color: var(--danger);
    font-weight: 800;
}

.optional-mark {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.field-help,
.field-feedback {
    display: block;
    margin: 5px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
}

.field-help:empty,
.field-feedback:empty {
    display: none;
}

.feedback-invalid {
    color: var(--danger);
}

input.field-valid,
select.field-valid {
    border-color: #76b58f;
    box-shadow: 0 0 0 3px rgba(25, 112, 68, 0.09);
}

input.field-invalid,
select.field-invalid {
    border-color: #d19a9a;
    box-shadow: 0 0 0 3px rgba(161, 55, 55, 0.08);
}

.honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.content > form > input + label {
    margin-top: 18px;
}

.register-link {
    margin: 20px 0 0;
    padding-top: 18px;
    border-top: 1px solid #e1e6eb;
    color: var(--text-secondary);
    text-align: center;
    font-size: 14px;
    line-height: 1.5;
}

.register-link a,
.back-link,
.profile-session-note a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.register-link a:hover,
.back-link:hover,
.profile-session-note a:hover {
    text-decoration: underline;
}

.back-link {
    display: block;
    margin: 0 32px 22px;
    text-align: center;
    font-size: 14px;
}

.message,
.result {
    margin: 20px 32px 0;
    padding: 15px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.message.error {
    border: 1px solid #e2b3b3;
    background: var(--danger-soft);
    color: var(--danger);
    font-weight: 700;
}

.message.success {
    border: 1px solid #b9dfc8;
    background: var(--success-soft);
    color: var(--success);
    font-weight: 700;
}

.message.info {
    border: 1px solid #c8daf2;
    background: var(--info-soft);
    color: var(--info);
    font-weight: 700;
}

.result {
    margin-bottom: 28px;
    border: 1px solid #cfdbe5;
    border-left: 4px solid var(--primary);
    background: #f8fbff;
    text-align: center;
}

.content > .header + .result {
    margin-top: 24px;
}

.kicker {
    display: block;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.points-summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    margin-top: 7px;
}

.points-summary strong {
    display: inline;
    margin: 0;
    color: #1d2c3b;
    font-size: 20px;
    line-height: 1.25;
}

.points-summary span {
    color: #5d6b7a;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
}

.progress {
    height: 8px;
    max-width: 520px;
    margin: 18px auto 0;
    overflow: hidden;
    border-radius: 4px;
    background: #e2e8ee;
}

.progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #5f9cff);
}

.result small {
    display: block;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 12px;
}

.registration-error-top {
    margin-top: 18px;
    margin-bottom: 0;
}

.registration-error-top span,
.registration-error-top small {
    display: block;
}

.registration-error-top small {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 600;
    opacity: 0.82;
}


.registration-callout {
    margin: 22px clamp(20px, 4vw, 38px) 4px;
    padding: 22px;
    border: 2px solid #1769ff;
    border-radius: 20px;
    background: linear-gradient(180deg, #f7faff, #ffffff);
    box-shadow: 0 14px 34px rgba(23, 105, 255, 0.12);
}

.registration-callout-icon {
    display: flex;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: #1769ff;
    color: #fff;
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
}

.registration-callout-copy {
    text-align: center;
}

.registration-callout-kicker {
    color: #1769ff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.registration-callout h2 {
    margin: 5px 0 7px;
    color: #17283a;
    font-size: 22px;
    line-height: 1.25;
}

.registration-callout p {
    max-width: 620px;
    margin: 0 auto;
    color: #5b6a79;
    font-size: 14px;
    line-height: 1.55;
}

.registration-callout-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.registration-start-form {
    margin: 0;
    padding: 0;
}

.registration-primary-button,
.registration-secondary-button {
    display: flex;
    width: 100%;
    min-height: 66px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    font-family: inherit;
    cursor: pointer;
}

.registration-primary-button {
    border: 1px solid #1769ff;
    background: #1769ff;
    color: #fff;
}

.registration-secondary-button {
    border: 1px solid #c7d7ef;
    background: #fff;
    color: #20364f;
}

.registration-primary-button > span:last-child,
.registration-secondary-button > span:last-child {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.registration-primary-button strong,
.registration-secondary-button strong {
    font-size: 14px;
    line-height: 1.25;
}

.registration-primary-button small,
.registration-secondary-button small {
    margin-top: 2px;
    font-size: 11px;
    font-weight: 600;
    opacity: .82;
}

.type-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 30px clamp(20px, 4vw, 38px) 26px;
}

.type-card {
    display: flex;
    min-height: 176px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 22px 18px;
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff, #fbfdff);
    color: #223448;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 5px 20px rgba(15, 35, 70, 0.045);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.type-card:hover {
    border-color: #b8cef5;
    background: #f8fbff;
    box-shadow: 0 10px 25px rgba(23, 105, 255, 0.10);
    transform: translateY(-2px);
}

.type-icon {
    display: flex;
    width: 52px;
    height: 52px;
    align-items: center;
    justify-content: center;
    margin-bottom: 13px;
    border-radius: 50%;
    background: linear-gradient(145deg, #2c7cff, var(--primary-dark));
    color: #ffffff;
    font-size: 23px;
    box-shadow: 0 8px 18px rgba(23, 105, 255, 0.22);
}

.type-card strong {
    display: block;
    color: #223448;
    font-size: 16px;
}

.type-card small {
    display: block;
    margin-top: 6px;
    color: #6a7888;
    font-size: 12px;
    line-height: 1.45;
}

.registration-grid {
    display: grid;
}

.privacy-check {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    margin-top: 20px !important;
    color: #536273;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
}

.privacy-check input[type="checkbox"] {
    appearance: auto;
    -webkit-appearance: checkbox;
    width: 18px !important;
    height: 18px !important;
    min-height: 18px !important;
    flex: 0 0 18px;
    margin: 1px 0 0;
    accent-color: var(--primary);
}

.profile-entry {
    padding: 0 32px 32px;
}

.profile-entry-button {
    display: flex;
    min-height: 76px;
    align-items: center;
    gap: 14px;
    padding: 15px 18px;
    border: 1px solid #cfe0fb;
    border-radius: 16px;
    background: #f7faff;
    color: var(--text);
    text-decoration: none;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.profile-entry-button:hover {
    border-color: #a9c8f8;
    box-shadow: 0 8px 22px rgba(23, 105, 255, 0.10);
    transform: translateY(-1px);
}

.profile-entry-icon {
    display: flex;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--primary-soft);
    font-size: 24px;
}

.profile-entry-button strong,
.profile-entry-button small {
    display: block;
}

.profile-entry-button strong {
    font-size: 16px;
}

.profile-entry-button small {
    margin-top: 3px;
    color: var(--text-secondary);
    font-size: 12px;
}

.profile-gate {
    max-width: 620px;
    margin: 0 auto;
    padding: 38px clamp(20px, 5vw, 44px) 42px;
    text-align: center;
}

.profile-gate-icon {
    display: flex;
    width: 62px;
    height: 62px;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    border-radius: 18px;
    background: var(--primary-soft);
    font-size: 30px;
}

.profile-gate h2 {
    margin: 0 0 9px;
    color: var(--text);
    font-size: 24px;
    line-height: 1.2;
}

.profile-gate > p {
    margin: 0 auto 22px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.profile-gate .profile-help-note {
    margin-top: -10px;
    color: #8993a1;
    font-size: 12px;
}

.compact-form {
    max-width: 430px;
    margin: 0 auto;
    text-align: left;
}

.inline-action-form {
    max-width: 430px;
    margin: 0 auto;
}

.inline-action-form .button-secondary {
    margin-top: 10px;
}

.code-input {
    height: 58px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 7px;
    text-align: center;
}

.profile-back {
    margin: 20px 0 0;
}

.profile-form {
    display: block;
}

.profile-section {
    padding: 24px;
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    background: #ffffff;
}

.profile-section + .profile-section {
    margin-top: 18px;
}

.profile-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid #edf0f4;
}

.profile-section-heading > span {
    display: flex;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--primary-soft);
    font-size: 21px;
}

.profile-section-heading h2 {
    margin: 0;
    color: var(--text);
    font-size: 19px;
    line-height: 1.25;
}

.profile-section-heading p {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
}

.readonly-field {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    border: 1px solid #e2e7ee;
    border-radius: 10px;
    padding: 11px 12px;
    background: #f6f8fa;
    color: #667085;
    font-size: 16px;
    letter-spacing: 1px;
}

.profile-save-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    margin-top: 20px;
}

.profile-save-bar button {
    margin-top: 0;
}

.profile-session-note {
    margin: -10px 20px 28px;
    color: #8993a1;
    font-size: 11px;
    line-height: 1.5;
    text-align: center;
}

.dm-site-footer {
    width: min(860px, 100%);
    padding: 18px 14px 22px;
    color: #98a2b3;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
    text-align: center;
}

@media (max-width: 680px) {
    .page {
        min-height: 100dvh;
        padding: 0;
    }

    .content {
        width: 100%;
        min-height: 100dvh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .dm-domain-header {
        padding: 24px 18px 22px;
        border-radius: 0;
    }

    .dm-domain-logo {
        width: 108px;
        height: 108px;
        max-width: 108px;
    }

    .dm-domain-name {
        font-size: 22px;
    }

    .dm-domain-header h1 {
        font-size: 27px;
    }

    .content > form,
    .registration-grid,
    .profile-form {
        padding: 24px 18px 32px;
    }

    .registration-callout {
        margin: 18px 15px 4px;
        padding: 18px 14px;
        border-radius: 16px;
    }

    .registration-callout-actions {
        grid-template-columns: 1fr;
    }

    .registration-primary-button,
    .registration-secondary-button {
        min-height: 62px;
    }

    .type-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 24px 18px;
    }

    .type-card {
        min-height: 146px;
        padding: 18px 12px;
    }

    .message,
    .result {
        margin-left: 18px;
        margin-right: 18px;
    }

    .result strong {
        font-size: 28px;
    }

    .back-link {
        margin-left: 18px;
        margin-right: 18px;
    }

    .profile-entry {
        padding: 0 18px 28px;
    }

    .profile-gate {
        padding: 32px 18px 36px;
    }

    .profile-section {
        padding: 20px 16px;
        border-radius: 16px;
    }

    .profile-save-bar {
        grid-template-columns: 1fr;
    }

    .profile-save-bar .action-link {
        min-height: 50px;
    }

    .dm-site-footer {
        padding: 15px 10px 18px;
        font-size: 10px;
    }
}

@media (max-width: 390px) {
    .dm-domain-header {
        padding-left: 16px;
        padding-right: 16px;
    }

    .dm-domain-logo {
        width: 96px;
        height: 96px;
        max-width: 96px;
    }

    .dm-domain-name {
        font-size: 21px;
    }

    .dm-domain-header h1 {
        font-size: 24px;
    }

    .content > form,
    .registration-grid,
    .profile-form,
    .type-grid {
        padding-left: 15px;
        padding-right: 15px;
    }

    .profile-entry {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Registro V1.8.1: formulario compacto, validación internacional y selectores nativos móviles */
.identity-type-select {
    background-color: #fff;
}

#city[disabled] {
    background: #f7f9fc;
    color: #667789;
}

#city_manual[hidden] {
    display: none;
}


/* iOS / móvil: mantener Provincia y Ciudad como controles <select> nativos.
   No se usa un desplegable JavaScript personalizado: Safari/iOS decide el picker
   del sistema y conserva el comportamiento táctil habitual del dispositivo. */
.native-mobile-select {
    appearance: auto;
    -webkit-appearance: menulist;
}

@media (max-width: 680px) {
    .native-mobile-select {
        min-height: 54px;
        padding-top: 12px;
        padding-bottom: 12px;
        font-size: 17px;
        line-height: 1.25;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(23, 105, 255, 0.10);
    }
}

/* Safari de iPhone/iPad: reforzar la apariencia del sistema operativo. */
@supports (-webkit-touch-callout: none) {
    .native-mobile-select {
        appearance: auto;
        -webkit-appearance: menulist;
    }
}
