/* Auth pages — professional light / dark shell */

html, body {
    touch-action: pan-x pan-y;
    -ms-touch-action: pan-x pan-y;
}

.bos-gradient {
    background: linear-gradient(180deg, #f0a03a 0%, #e07a1a 55%, #c45f12 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

html.dark .bos-gradient {
    background: linear-gradient(180deg, #ffe09a 0%, #f0a03a 48%, #e07a1a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth-page-bg {
    background:
        radial-gradient(ellipse 70% 50% at 100% 0%, rgba(240, 160, 58, 0.16) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 0% 100%, rgba(224, 122, 26, 0.08) 0%, transparent 50%),
        #f4f2ef;
}

html.dark .auth-page-bg {
    background:
        radial-gradient(ellipse 70% 50% at 100% 0%, rgba(240, 160, 58, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 0% 100%, rgba(80, 120, 200, 0.1) 0%, transparent 50%),
        #120e0b;
}

.auth-panel {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(26, 18, 12, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 18px 50px rgba(26, 18, 12, 0.08);
}

html.dark .auth-panel {
    background: rgba(22, 16, 12, 0.78);
    border: 1px solid rgba(255, 246, 234, 0.12);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.auth-input,
.auth-select {
    width: 100%;
    min-height: 48px;
    padding: 0.75rem 1rem;
    border-radius: 0.875rem;
    border: 1px solid rgba(26, 18, 12, 0.12);
    background: #faf9f7;
    color: #1a120c;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

html.dark .auth-input,
html.dark .auth-select {
    border-color: rgba(255, 246, 234, 0.16);
    background: rgba(255, 246, 234, 0.06);
    color: #fff6ea;
}

.auth-input::placeholder {
    color: rgba(26, 18, 12, 0.4);
}

html.dark .auth-input::placeholder {
    color: rgba(255, 246, 234, 0.4);
}

.auth-input:focus,
.auth-select:focus {
    outline: none;
    border-color: rgba(224, 122, 26, 0.7);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(240, 160, 58, 0.15);
}

html.dark .auth-input:focus,
html.dark .auth-select:focus {
    background: rgba(255, 246, 234, 0.1);
}

.auth-input-wrap {
    position: relative;
}

.auth-input-wrap .auth-input {
    padding-right: 2.75rem;
}

.auth-toggle-pass {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(26, 18, 12, 0.45);
    cursor: pointer;
    padding: 0.25rem;
}

html.dark .auth-toggle-pass {
    color: rgba(255, 246, 234, 0.55);
}

.auth-toggle-pass:hover {
    color: #1a120c;
}

html.dark .auth-toggle-pass:hover {
    color: #fff6ea;
}

.auth-btn {
    width: 100%;
    min-height: 52px;
    border: none;
    border-radius: 0.875rem;
    font-weight: 700;
    font-size: 0.98rem;
    cursor: pointer;
    color: #1a1008;
    background: linear-gradient(135deg, #f2b14a 0%, #e07a1a 100%);
    box-shadow: 0 10px 28px rgba(224, 122, 26, 0.28);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(224, 122, 26, 0.38);
}

.auth-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Selectable cards (business type, sector, sub-types).
   Lists flow with the page instead of scrolling inside fixed-height boxes,
   so they fit any screen height. */
.type-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}

@media (min-width: 640px) {
    .type-card-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.75rem; }
    .type-card-grid--sector { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

@media (max-width: 339px) {
    .type-card-grid { grid-template-columns: minmax(0, 1fr); }
}

.type-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    width: 100%;
    min-width: 0;
    text-align: left;
    padding: 0.85rem;
    border-radius: 1rem;
    border: 1.5px solid rgba(26, 18, 12, 0.09);
    background: #fff;
    color: inherit;
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

html.dark .type-card {
    border-color: rgba(255, 246, 234, 0.12);
    background: rgba(255, 246, 234, 0.04);
}

.type-card:hover {
    border-color: rgba(224, 122, 26, 0.45);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -12px rgba(26, 18, 12, 0.25);
}

.type-card:active { transform: scale(0.98); }

.type-card:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(240, 160, 58, 0.45);
}

.type-card.selected {
    border-color: #e07a1a;
    background: linear-gradient(160deg, rgba(255, 210, 122, 0.22), rgba(240, 160, 58, 0.08));
    box-shadow: 0 0 0 3px rgba(240, 160, 58, 0.16), 0 12px 26px -14px rgba(224, 122, 26, 0.55);
}

html.dark .type-card.selected {
    background: linear-gradient(160deg, rgba(255, 210, 122, 0.16), rgba(240, 160, 58, 0.06));
}

.type-card-icon {
    flex-shrink: 0;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 0.75rem;
    display: grid;
    place-items: center;
    background: rgba(240, 160, 58, 0.14);
    color: #c45f12;
    font-size: 0.95rem;
    transition: background 0.2s ease, color 0.2s ease, transform 0.25s ease;
}

html.dark .type-card-icon {
    background: rgba(255, 210, 122, 0.12);
    color: #ffd27a;
}

.type-card:hover .type-card-icon { transform: rotate(-6deg) scale(1.05); }

.type-card.selected .type-card-icon {
    background: linear-gradient(145deg, #f2b14a 0%, #e07a1a 100%);
    color: #1a1008;
}

.type-card-body {
    flex: 1;
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding-right: 1.4rem;
}

.type-card-title {
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.type-card-desc {
    font-size: 0.74rem;
    line-height: 1.35;
    color: rgba(26, 18, 12, 0.55);
}

html.dark .type-card-desc {
    color: rgba(255, 246, 234, 0.55);
}

.type-card-check {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 9999px;
    border: 1.5px solid rgba(26, 18, 12, 0.16);
    display: grid;
    place-items: center;
    color: transparent;
    font-size: 0.6rem;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

html.dark .type-card-check {
    border-color: rgba(255, 246, 234, 0.22);
}

.type-card.selected .type-card-check {
    border-color: #e07a1a;
    background: #e07a1a;
    color: #fff;
    transform: scale(1.12);
}

/* Compact row variant (sectors): no repeated icon, title + check on one line */
.type-card--row {
    flex-direction: row;
    align-items: center;
    min-height: 3.25rem;
    padding: 0.7rem 0.85rem;
}

.type-card--row .type-card-body { padding-right: 1.6rem; }

.type-card--row .type-card-check {
    top: 50%;
    margin-top: -0.6rem;
}

.type-card--row.selected .type-card-check { transform: scale(1.12); }

@media (min-width: 640px) {
    .type-card { flex-direction: row; align-items: flex-start; padding: 0.9rem 1rem; }
    .type-card--row { align-items: center; }
}

/* Short screens (landscape phones, low-resolution devices) */
@media (max-height: 600px), (max-width: 359px) {
    .type-card { padding: 0.65rem 0.7rem; gap: 0.45rem; border-radius: 0.85rem; }
    .type-card-icon { width: 2rem; height: 2rem; font-size: 0.8rem; border-radius: 0.6rem; }
    .type-card-title { font-size: 0.82rem; }
    .type-card-desc { display: none; }
    .type-card--row { min-height: 2.75rem; }
    .type-card-grid { gap: 0.45rem; }
}

@media (max-width: 339px) {
    .type-card { flex-direction: row; align-items: center; }
    .type-card-check { top: 50%; margin-top: -0.6rem; }
}

.auth-btn-secondary {
    width: 100%;
    min-height: 52px;
    border-radius: 0.875rem;
    font-weight: 700;
    font-size: 0.98rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    border: 1px solid rgba(26, 18, 12, 0.14);
    background: transparent;
    color: #1a120c;
    transition: transform 0.3s ease, background 0.25s ease, border-color 0.25s ease;
}

html.dark .auth-btn-secondary {
    border-color: rgba(255, 246, 234, 0.2);
    color: #fff6ea;
}

.auth-btn-secondary:hover {
    transform: translateY(-2px);
    background: rgba(26, 18, 12, 0.04);
}

html.dark .auth-btn-secondary:hover {
    background: rgba(255, 246, 234, 0.08);
}

.auth-error {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-radius: 0.875rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 0.9rem;
}

html.dark .auth-error {
    background: rgba(127, 29, 29, 0.4);
    border-color: rgba(248, 113, 113, 0.35);
    color: #fecaca;
}

.auth-success {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-radius: 0.875rem;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    font-size: 0.9rem;
}

html.dark .auth-success {
    background: rgba(6, 78, 59, 0.4);
    border-color: rgba(52, 211, 153, 0.35);
    color: #a7f3d0;
}

.auth-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(26, 18, 12, 0.1);
    background: #fff;
    cursor: pointer;
    color: #1a120c;
    font-size: 0.875rem;
}

html.dark .auth-chip {
    border-color: rgba(255, 246, 234, 0.14);
    background: rgba(255, 246, 234, 0.05);
    color: #fff6ea;
}

.auth-plan {
    border: 1.5px solid rgba(26, 18, 12, 0.1);
    border-radius: 0.875rem;
    padding: 0.9rem 1rem;
    cursor: pointer;
    background: #faf9f7;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

html.dark .auth-plan {
    border-color: rgba(255, 246, 234, 0.14);
    background: rgba(255, 246, 234, 0.04);
}

.auth-plan:hover {
    border-color: rgba(224, 122, 26, 0.55);
    transform: translateY(-1px);
}

.auth-plan.selected {
    border-color: #e07a1a;
    background: rgba(240, 160, 58, 0.12);
}

html.dark .auth-plan.selected {
    background: rgba(240, 160, 58, 0.16);
}

/* Registration progress (compact, fits any width) */
.auth-progress-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(26, 18, 12, 0.5);
}

html.dark .auth-progress-top { color: rgba(255, 246, 234, 0.55); }

.auth-progress-top strong {
    font-size: 0.85rem;
    font-weight: 800;
    color: #c45f12;
}

html.dark .auth-progress-top strong { color: #ffd27a; }

.auth-progress-bar {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-progress-bar li { min-width: 0; }

.auth-progress-bar .seg {
    display: block;
    height: 6px;
    border-radius: 9999px;
    background: rgba(26, 18, 12, 0.1);
    overflow: hidden;
    position: relative;
}

html.dark .auth-progress-bar .seg { background: rgba(255, 246, 234, 0.12); }

.auth-progress-bar .seg::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-progress-bar li.done .seg::after { transform: scaleX(1); background: #10b981; }
.auth-progress-bar li.active .seg::after { transform: scaleX(1); background: linear-gradient(90deg, #f2b14a, #e07a1a); }

.auth-progress-bar .lbl {
    display: none;
    margin-top: 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(26, 18, 12, 0.42);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

html.dark .auth-progress-bar .lbl { color: rgba(255, 246, 234, 0.42); }
.auth-progress-bar li.done .lbl { color: #059669; }
.auth-progress-bar li.active .lbl { color: #c45f12; font-weight: 800; }
html.dark .auth-progress-bar li.active .lbl { color: #ffd27a; }

@media (min-width: 640px) {
    .auth-progress-bar .lbl { display: block; }
}

@media (max-height: 480px) {
    .auth-progress-bar .lbl { display: none; }
}

/* Action bar that stays reachable on selection steps */
.auth-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.auth-actions.is-single { grid-template-columns: minmax(0, 1fr); }

.auth-actions.is-sticky {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin: 0 -1.25rem -1.25rem;
    padding: 0.85rem 1.25rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid rgba(26, 18, 12, 0.08);
    border-radius: 0 0 1rem 1rem;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

html.dark .auth-actions.is-sticky {
    background: rgba(22, 16, 12, 0.88);
    border-top-color: rgba(255, 246, 234, 0.1);
}

@media (min-width: 640px) {
    .auth-actions.is-sticky { margin: 0 -1.75rem -1.75rem; padding-left: 1.75rem; padding-right: 1.75rem; }
}

@media (max-height: 600px) {
    .auth-actions .auth-btn,
    .auth-actions .auth-btn-secondary { min-height: 44px; }
    .auth-actions.is-sticky { padding-top: 0.6rem; padding-bottom: calc(0.6rem + env(safe-area-inset-bottom, 0px)); }
}

.auth-step-num {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    display: grid;
    place-items: center;
    font-size: 0.8rem;
    font-weight: 700;
    background: rgba(26, 18, 12, 0.08);
    color: rgba(26, 18, 12, 0.45);
}

html.dark .auth-step-num {
    background: rgba(255, 246, 234, 0.1);
    color: rgba(255, 246, 234, 0.45);
}

.auth-step.active .auth-step-num {
    background: linear-gradient(135deg, #f2b14a 0%, #e07a1a 100%);
    color: #1a1008;
}

.auth-step.completed .auth-step-num {
    background: #10b981;
    color: #fff;
}

.auth-step-line {
    position: absolute;
    top: 1rem;
    left: 8%;
    right: 8%;
    height: 2px;
    background: rgba(26, 18, 12, 0.1);
    z-index: 0;
}

html.dark .auth-step-line {
    background: rgba(255, 246, 234, 0.12);
}

.auth-step-line-fill {
    position: absolute;
    top: 1rem;
    left: 8%;
    height: 2px;
    background: #10b981;
    z-index: 1;
    transition: width 0.3s ease;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(26, 18, 12, 0.12);
    background: rgba(255, 255, 255, 0.7);
    color: #1a120c;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

html.dark .theme-toggle {
    border-color: rgba(255, 246, 234, 0.18);
    background: rgba(255, 246, 234, 0.08);
    color: #fff6ea;
}

.theme-toggle:hover {
    transform: translateY(-1px);
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline; }
html.dark .theme-toggle .icon-sun { display: inline; }
html.dark .theme-toggle .icon-moon { display: none; }

/* Select2 dark-aware overrides */
.select2-container .select2-selection--single {
    height: 48px !important;
    border-radius: 0.875rem !important;
    border: 1px solid rgba(26, 18, 12, 0.12) !important;
    background: #faf9f7 !important;
}
html.dark .select2-container .select2-selection--single {
    border-color: rgba(255, 246, 234, 0.16) !important;
    background: rgba(255, 246, 234, 0.06) !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 46px !important;
    padding-left: 1rem !important;
    color: #1a120c !important;
}
html.dark .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #fff6ea !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 46px !important;
}
html.dark .select2-dropdown {
    background: #1a140f !important;
    border-color: rgba(255, 246, 234, 0.16) !important;
    color: #fff6ea !important;
}
html.dark .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: #e07a1a !important;
}

.g_id_signin > div { width: 100% !important; }

@keyframes riseIn {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

.rise-in {
    animation: riseIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (prefers-reduced-motion: reduce) {
    .rise-in { animation: none !important; opacity: 1; transform: none; }
    .type-card, .type-card-icon, .type-card-check, .auth-progress-bar .seg::after { transition: none !important; }
}
