/**
 * Advisor registration page (Figma: 10-advisor register-page.png)
 */

.advisor-register-page {
    padding-bottom: var(--section-y, 88px);
    background-color: var(--color-bg-soft, #fafafa);
}

/* ── Header ─────────────────────────────────────────────────────────── */

/* Layout comes from the shared .page-header alias in main.css. */
.advisor-register__header {
    text-align: center;
}

.advisor-register__title {
    font-size: var(--h1-size, 40px);
    font-weight: var(--h1-weight, 800);
    color: #202C3F;
    margin: 0 0 var(--space-4, 15px);
    line-height: var(--h1-lh, 1.15);
}

.advisor-register__subtitle {
    font-size: var(--lead-size, 19px);
    color: var(--color-text);
    margin: 0;
}

/* ── Layout ─────────────────────────────────────────────────────────── */

.advisor-register__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--stack, 24px);
}

@media (max-width: 900px) {
    .advisor-register__grid {
        grid-template-columns: 1fr;
    }
}

.register-card {
    background: #fff;
    border: var(--card-border, 1px solid #e8ebf3);
    border-radius: var(--radius-card, 12px);
    padding: var(--card-pad, 28px);
    margin-bottom: var(--stack, 24px);
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
}

.advisor-register__grid .register-card {
    margin-bottom: 0;
}

.advisor-register__grid {
    margin-bottom: var(--stack, 24px);
}

.register-card__title {
    font-size: var(--h2-size, 34px);
    font-weight: var(--heading-weight, 800);
    color: #202C3F;
    margin: 0 0 20px;
    line-height: var(--h2-lh, 1.2);
}

/* Help line directly under a card title (pulls up against the title margin) */
.register-card__hint {
    font-size: var(--text-size, 17px);
    color: var(--color-text);
    margin: -14px 0 18px;
}

/* ── Form fields ────────────────────────────────────────────────────── */

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

.form-field label {
    display: block;
    font-size: var(--text-sm, 15px);
    font-weight: 700;
    color: var(--color-black);
    margin-bottom: 6px;
}

.form-field .required {
    color: #DC2626;
}

.form-field input,
.form-field textarea,
.form-field select {
    width: 100%;
    min-height: var(--field-height, 56px);
    padding: 14px 16px;
    background: var(--field-bg, #f3f3f3);
    border: var(--field-border, 1px solid #e8ebf3);
    border-radius: var(--radius-field, 10px);
    font-size: var(--field-font, 17px);
    line-height: 1.5;
    color: #202C3F;
    font-family: inherit;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
    outline: 2px solid #06A651;
    outline-offset: -1px;
    background: #fff;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
    color: #B0B3BC;
}

.form-field__hint {
    display: block;
    font-size: var(--font-size-sm, 14px);
    font-weight: 400;
    color: var(--color-text-strong, #4b5563);
    margin-top: 4px;
}

/* Both columns are flex cards whose tall element grows to fill, so the
   logo/video card (left) and the company-info card (right) stay equal height. */
.register-card--company,
.register-card--media {
    display: flex;
    flex-direction: column;
}

.register-card--company .form-field--description {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.register-card--company .form-field--description textarea {
    flex: 1 1 auto;
    min-height: 140px;
    resize: vertical;
}

/* The video dropzone fills the remaining height of the left card so it
   matches the right column. */
.register-card--media .video-dropzone {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.form-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-field-row .form-field--grow {
    grid-column: 1 / -1;
}

@media (max-width: 600px) {
    .form-field-row {
        grid-template-columns: 1fr;
    }
}

/* ── Logo / video upload ────────────────────────────────────────────── */

.logo-upload {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-upload__preview {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    background: #EDEFF3;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.logo-upload__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-hint {
    font-size: var(--text-sm, 15px);
    font-weight: 700;
    color: var(--color-black);
    margin: 8px 0 20px;
}

.btn-dark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--btn-height-sm, 48px);
    background: var(--color-dark-green, #0a392c);
    color: #fff;
    font-size: var(--text-size, 17px);
    font-weight: var(--btn-weight, 800);
    line-height: 1.2;
    padding: 0 28px;
    border-radius: var(--radius-btn, 8px);
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-dark:hover {
    background: #145239;
    color: #fff;
}

.video-dropzone {
    border: 2px dashed #D4D8E2;
    border-radius: 12px;
    padding: 40px 24px;
    text-align: center;
}

.video-dropzone__icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #EFF6F1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.video-dropzone__title {
    font-size: var(--card-title-size, 20px);
    font-weight: var(--heading-weight, 800);
    color: #0E3D2C;
    margin: 0 0 6px;
    word-break: break-all;
}

.video-dropzone__hint {
    font-size: var(--text-sm, 15px);
    font-weight: 700;
    color: var(--color-black);
    margin: 0 0 18px;
}

/* ── Service tables ─────────────────────────────────────────────────── */

.service-table__head {
    display: grid;
    gap: 16px;
    font-size: var(--text-sm, 15px);
    font-weight: 700;
    color: var(--color-black);
    padding: 0 0 10px;
}

/* Shared info icon — inherits the surrounding text colour (currentColor). */
.el24-info-icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    vertical-align: -1px;
    margin-left: 2px;
    flex-shrink: 0;
}

/* ── Info-icon tooltip (el24_help_tip) ──────────────────────────────────
   Same dark-green tooltip style as the app dashboards (shared Tooltip /
   HelpTip React components) — hover or keyboard-focus the icon to show. */
.el24-tip {
    position: relative;
    display: inline-flex;
    cursor: help;
    color: #898C97;
}

.el24-tip:hover,
.el24-tip:focus {
    color: #202C3F;
    outline: none;
}

.el24-tip::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 224px;
    background: #0E4234;
    color: #fff;
    font-size: var(--font-size-xs, 13px);
    font-weight: 400;
    line-height: 1.625;
    text-align: left;
    white-space: normal;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s;
    pointer-events: none;
    z-index: 60;
}

/* Arrow */
.el24-tip::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 8px;
    height: 8px;
    background: #0E4234;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s;
    pointer-events: none;
    z-index: 61;
}

.el24-tip:hover::after,
.el24-tip:hover::before,
.el24-tip:focus::after,
.el24-tip:focus::before {
    opacity: 1;
    visibility: visible;
}

/* Areas are coverage only — no price column. */
.service-table__head--area,
.service-row--area {
    grid-template-columns: minmax(170px, 1.6fr) minmax(130px, 1fr) 70px 90px;
}

.service-table__head--size,
.service-row--size {
    grid-template-columns: minmax(170px, 1.3fr) 130px minmax(240px, 1.6fr) 70px 90px;
}

.service-row {
    display: grid;
    gap: 16px;
    align-items: center;
    padding: 10px 0;
}

/* Dense service tables keep a compact 44px field (documented exception). */
.service-row input,
.service-row select {
    min-height: 44px;
    padding: 9px 12px;
    background: var(--field-bg, #f3f3f3);
    border: var(--field-border, 1px solid #e8ebf3);
    border-radius: var(--radius-field, 10px);
    font-size: var(--text-sm, 15px);
    color: #202C3F;
    width: 100%;
    font-family: inherit;
}

.service-row input:focus,
.service-row select:focus {
    outline: 2px solid #06A651;
    outline-offset: -1px;
    background: #fff;
}

.service-row__range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.service-row__dash {
    color: #898C97;
}

.service-row__price {
    display: flex;
    align-items: center;
    gap: 6px;
}

.service-row__price span {
    color: #898C97;
}

.service-row__price input {
    -moz-appearance: textfield;
}

.service-row__price input::-webkit-outer-spin-button,
.service-row__price input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.service-row__services {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.service-pill {
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid #898C97;
    background: transparent;
    color: #202C3F;
    font-size: var(--font-size-sm, 14px);
    cursor: pointer;
    transition: all 0.15s;
}

.service-pill--active {
    border-color: #06A651;
    color: #06A651;
    background: #F0F8F1;
    font-weight: 500;
}

/* Urgent toggle */

.urgent-switch {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.urgent-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.urgent-switch__track {
    display: block;
    width: 60px;
    height: 32px;
    border-radius: 999px;
    background: var(--color-dark-grey);
    position: relative;
    transition: background 0.15s;
}

.urgent-switch__track::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    transition: transform 0.15s;
}

.urgent-switch input:checked + .urgent-switch__track {
    background: #06A651;
}

.urgent-switch input:checked + .urgent-switch__track::after {
    transform: translateX(28px);
}

/* Grow the knob slightly on hover. */
.urgent-switch:hover .urgent-switch__track::after {
    transform: scale(1.12);
}

.urgent-switch:hover input:checked + .urgent-switch__track::after {
    transform: translateX(28px) scale(1.12);
}

/* Row action buttons */

.service-row__actions {
    display: flex;
    gap: 8px;
}

.row-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: transparent;
    transition: all 0.15s;
}

.row-btn--delete {
    border: 1px solid #202C3F;
    color: #202C3F;
}

.row-btn--delete:hover:not(:disabled) {
    background: #FEF2F2;
    border-color: #DC2626;
    color: #DC2626;
}

.row-btn--delete:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.row-btn--add {
    border: 1px solid #06A651;
    color: #06A651;
}

.row-btn--add:hover {
    background: #F0F8F1;
}

@media (max-width: 900px) {
    .service-table__head {
        display: none;
    }

    .service-row {
        grid-template-columns: 1fr;
        border: 1px solid #E8EBF3;
        border-radius: 10px;
        padding: 16px;
        margin-bottom: 12px;
    }
}

/* ── Terms + submit ─────────────────────────────────────────────────── */

.register-card--footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.terms-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--text-sm, 15px);
    color: #202C3F;
    cursor: pointer;
}

.terms-checkbox a {
    color: #2563EB;
    text-decoration: underline;
}

.terms-checkbox input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.terms-checkbox__box {
    width: 20px;
    height: 20px;
    border: 1px solid #898C97;
    border-radius: 4px;
    flex-shrink: 0;
    position: relative;
    transition: all 0.15s;
}

.terms-checkbox input:checked + .terms-checkbox__box {
    background: #06A651;
    border-color: #06A651;
}

.terms-checkbox input:checked + .terms-checkbox__box::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.terms-checkbox input:focus-visible + .terms-checkbox__box {
    outline: 2px solid #06A651;
    outline-offset: 2px;
}

.btn-register {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--btn-height, 56px);
    background: var(--color-main-text, #047a3c);
    color: #fff;
    font-size: var(--btn-font, 18px);
    font-weight: var(--btn-weight, 800);
    line-height: 1.2;
    padding: 0 48px;
    border-radius: var(--radius-btn, 8px);
    border: none;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s;
}

.btn-register:hover {
    background: var(--color-main-text-dark, #03602f);
    color: #fff;
}

.btn-register:disabled,
.btn-register--loading {
    opacity: 0.6;
    cursor: wait;
}

.btn-register--block {
    display: block;
    width: 100%;
}

/* ── Error box ──────────────────────────────────────────────────────── */

.advisor-register__error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #B91C1C;
    border-radius: 8px;
    padding: 14px 18px;
    font-size: var(--text-sm, 15px);
    margin-bottom: 24px;
}

/* ── Honeypot ───────────────────────────────────────────────────────── */

.el24-hp-field {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    opacity: 0;
}

/* ── Success modal ──────────────────────────────────────────────────── */

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

.register-modal[hidden] {
    display: none;
}

.register-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(32, 44, 63, 0.55);
}

.register-modal__content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 48px 40px 40px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(16, 24, 40, 0.25);
}

.register-modal__close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: #898C97;
    cursor: pointer;
}

.register-modal__icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #F0F8F1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 22px;
}

.register-modal__content h2 {
    font-size: var(--h3-size, 22px);
    font-weight: var(--heading-weight, 800);
    color: #202C3F;
    margin: 0 0 10px;
}

.register-modal__content p {
    font-size: var(--text-size, 17px);
    color: var(--color-text-strong, #4b5563);
    margin: 0 0 28px;
}

/* ── Validation: invalid fields + inline errors ─────────────────────── */

.form-field input.is-invalid,
.form-field select.is-invalid,
.form-field textarea.is-invalid {
    border-color: #DC2626;
    background: #FEF2F2;
}

.form-field input.is-invalid:focus,
.form-field select.is-invalid:focus,
.form-field textarea.is-invalid:focus {
    outline: 2px solid #DC2626;
}

.field-error {
    display: block;
    color: #DC2626;
    font-size: var(--font-size-xs, 13px);
    margin-top: 6px;
}

.field-error[hidden] {
    display: none;
}

.terms-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ── Video upload progress ──────────────────────────────────────────── */

.video-upload-progress {
    width: 100%;
    margin: 4px 0 16px;
}

.video-upload-progress[hidden] {
    display: none;
}

.video-upload-progress__track {
    height: 8px;
    width: 100%;
    background: #E8EBF3;
    border-radius: 999px;
    overflow: hidden;
}

.video-upload-progress__fill {
    height: 100%;
    width: 0;
    background: #06A651;
    border-radius: 999px;
    transition: width 0.2s ease;
}

.video-upload-progress__label {
    margin: 8px 0 0;
    font-size: var(--font-size-sm, 14px);
    color: #06603A;
    font-weight: 500;
}

/* ── Submitting overlay ─────────────────────────────────────────────── */

.register-loading {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(32, 44, 63, 0.55);
}

.register-loading[hidden] {
    display: none;
}

.register-loading__box {
    background: #fff;
    border-radius: 14px;
    padding: 32px 40px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(16, 24, 40, 0.25);
}

.register-loading__spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #E8EBF3;
    border-top-color: #06A651;
    border-radius: 50%;
    animation: el24-spin 0.8s linear infinite;
}

.register-loading__text {
    margin: 16px 0 0;
    font-size: 15px;
    font-weight: 500;
    color: #202C3F;
}

@keyframes el24-spin {
    to { transform: rotate(360deg); }
}

/* Canon: the register page follows the site's heading scale; the tokens come
   from main.css (h1 40/32, h2 28/24). Mobile sizes mirror the theme's own
   767px breakpoint. */
@media (max-width: 767px) {
  .advisor-register__title { font-size: var(--h1-size-mobile, 36px); }
  .register-card__title { font-size: var(--h2-size-mobile, 28px); }
}
