/* Onboarding Flow Styles */

.onboarding-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 24px;
    min-height: calc(100vh - 200px);
}

/* Progress Bar */
.onboarding-progress {
    margin-bottom: 48px;
}

.progress-bar {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
}

.progress-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.progress-step::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    right: -50%;
    height: 2px;
    background: var(--border-color);
    z-index: -1;
}

.progress-step:last-child::before {
    display: none;
}

.progress-step.active::before {
    background: var(--primary-color);
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.progress-step.active .step-number {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.progress-step.completed .step-number {
    border-color: var(--success-color);
    background: var(--success-color);
    color: white;
}

.progress-step.completed .step-number::after {
    content: '✓';
    font-size: 20px;
}

.step-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.progress-step.active .step-label {
    color: var(--primary-color);
    font-weight: 600;
}

/* Onboarding Steps */
.onboarding-content {
    background: white;
    border-radius: 12px;
    padding: 48px;
    box-shadow: var(--shadow);
}

.onboarding-step {
    display: none;
}

.onboarding-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-header {
    text-align: center;
    margin-bottom: 40px;
}

.step-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.step-header p {
    font-size: 16px;
    color: var(--text-secondary);
}

/* Forms */
.onboarding-form {
    max-width: 600px;
    margin: 0 auto;
}

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

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45, 80, 22, 0.1);
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 14px;
}

.eircode-lookup {
    display: flex;
    gap: 10px;
}

.eircode-lookup input {
    flex: 1;
}

.lookup-button {
    padding: 12px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.lookup-button:hover {
    background: var(--primary-dark);
}

.form-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 32px;
}

.form-actions .btn-cta {
    padding: 14px 28px;
    font-size: 17px;
    font-weight: 600;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(45, 80, 22, 0.25);
}

.form-actions .btn-cta:hover {
    box-shadow: 0 4px 12px rgba(45, 80, 22, 0.3);
}

.form-actions-step2 {
    justify-content: space-between;
    align-items: center;
}

.onboarding-divider {
    text-align: center;
    margin: 20px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.sign-in-toggle {
    text-align: center;
    margin-top: 16px;
}

.sign-in-toggle .btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
}

.sign-in-toggle .btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.onboarding-google-signin {
    margin-bottom: 16px;
    min-height: 44px;
    display: flex;
    justify-content: center;
}
.onboarding-google-signin iframe {
    margin: 0 auto;
}

.onboarding-error {
    padding: 12px 16px;
    margin-bottom: 16px;
    background: rgba(196, 30, 58, 0.1);
    border: 1px solid var(--error-color);
    border-radius: var(--border-radius);
    color: var(--error-color);
    font-size: 14px;
}

/* Membership Selection */
.membership-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.membership-option {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.membership-option:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(45, 80, 22, 0.1);
}

.membership-option.selected {
    border-color: var(--primary-color);
    background: rgba(45, 80, 22, 0.05);
}

.option-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.option-header .option-price {
    margin-left: auto;
}

.option-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.option-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem;
    justify-content: flex-end;
}

.option-price-now {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.option-price-was {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary, #666);
    text-decoration: line-through;
}

.option-price-period {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
}

.membership-price-note {
    grid-column: 1 / -1;
    margin: 0 0 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--text-secondary, #444);
    background: var(--bg-secondary, #f6f7f5);
    border: 1px solid var(--border-color, #ddd);
    border-radius: var(--border-radius, 8px);
}

.membership-price-note[hidden] {
    display: none !important;
}

.selected-price-note {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    color: var(--text-secondary, #666);
}

.option-features {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
}

.option-features li {
    padding: 8px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.option-badge-inline {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    width: 100%;
    text-align: center;
}

.payment-section {
    margin-top: 32px;
    padding: 24px;
    background: var(--background-alt);
    border-radius: var(--border-radius);
}

.payment-info {
    margin-bottom: 16px;
}

.payment-info p {
    margin: 8px 0;
    font-size: 16px;
}

.payment-note {
    margin-top: 16px;
    padding: 16px;
    background: white;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.payment-note p {
    margin: 4px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Insurance Step */
.insurance-content {
    max-width: 700px;
    margin: 0 auto;
}

.info-box {
    background: var(--background-alt);
    padding: 24px;
    border-radius: var(--border-radius);
    margin-bottom: 32px;
}

.info-box h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.info-box p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.insurance-steps {
    margin-bottom: 32px;
}

.insurance-step {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    align-items: flex-start;
}

.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.step-content p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

.insurance-note {
    margin-top: 24px;
    text-align: center;
}

/* Completion Screen */
.completion-screen {
    text-align: center;
    padding: 60px 20px;
}

.completion-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--success-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 700;
    margin: 0 auto 24px;
}

.completion-screen h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.completion-screen p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.completion-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
    .onboarding-container {
        padding: 24px 16px;
    }

    .onboarding-content {
        padding: 32px 24px;
    }

    .membership-selection {
        grid-template-columns: 1fr;
    }

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

    .progress-steps {
        flex-wrap: wrap;
    }

    .progress-step {
        min-width: 80px;
        margin-bottom: 16px;
    }

    .step-label {
        font-size: 12px;
    }

    .completion-actions {
        flex-direction: column;
    }
}

/* Error/Success Messages */
.onboarding-message {
    max-width: 900px;
    margin: 0 auto 24px;
    padding: 16px 20px;
    border-radius: var(--border-radius);
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

.onboarding-message.error {
    background: rgba(196, 30, 58, 0.1);
    border: 2px solid var(--error-color);
    color: var(--error-color);
}

.onboarding-message.success {
    background: rgba(40, 167, 69, 0.1);
    border: 2px solid var(--success-color);
    color: var(--success-color);
}

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

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Single entry: hero + two paths (mobile-first) */
.onboarding-hero {
    text-align: center;
    margin-bottom: 2rem;
    padding: 0 0.5rem;
}

.onboarding-hero h1 {
    font-size: clamp(1.75rem, 5vw, 2.25rem);
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.onboarding-hero-sub {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 28rem;
    margin: 0 auto;
    line-height: 1.5;
}

.onboarding-hero-sub.subtle {
    margin-top: 1rem;
    font-size: 0.9rem;
    max-width: 34rem;
}

.onboarding-choice-grid {
    display: grid;
    gap: 1.5rem;
    max-width: 520px;
    margin: 0 auto 2rem;
}

@media (min-width: 640px) {
    .onboarding-choice-grid {
        max-width: 720px;
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
    }
}

.choice-card {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem 1.25rem;
    text-align: center;
    background: var(--bg-secondary, #fff);
}

.choice-card-accent {
    border-color: var(--primary-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.choice-heading {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.choice-copy {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    line-height: 1.45;
}

.choice-copy.subtle {
    margin-top: 1rem;
    margin-bottom: 0;
    font-size: 0.875rem;
}

.google-btn-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 48px;
}

.google-btn-wrap iframe {
    margin: 0 auto !important;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
    padding: 0;
}

.signed-in-pending {
    max-width: 520px;
    margin: 0.5rem auto 0;
    text-align: center;
    padding: 0 0.5rem 1rem;
}

.pending-card {
    text-align: left;
    padding: 1.5rem 1.35rem 1.25rem;
    border: 1px solid var(--border-color, #d8ddd4);
    border-radius: var(--border-radius, 8px);
    background: var(--bg-secondary, #fff);
}

.pending-pill {
    display: inline-block;
    margin: 0 0 0.85rem;
    padding: 0.28rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-secondary, #555);
    background: var(--bg-primary, #f4f5f2);
    border: 1px solid var(--border-color, #d8ddd4);
    border-radius: 4px;
}

.pending-pill[data-tone='approval'] {
    color: #1e3a5f;
    background: #e8f0f8;
    border-color: #c5d6e8;
}

.signed-in-pending .choice-heading {
    margin: 0 0 0.65rem;
    font-size: 1.45rem;
    line-height: 1.25;
}

.signed-in-pending .choice-copy {
    margin: 0 0 1rem;
    line-height: 1.55;
    color: var(--text-secondary, #444);
}

.pending-steps {
    margin: 0 0 1.35rem;
    padding: 0 0 0 1.15rem;
    color: var(--text-primary, #222);
    line-height: 1.55;
    text-align: left;
}

.pending-steps li {
    margin-bottom: 0.35rem;
}

.pending-steps[hidden],
.pending-offline[hidden] {
    display: none !important;
}

.pending-cta {
    width: 100%;
    justify-content: center;
    margin-bottom: 1rem;
}

.pending-offline {
    margin: 0 0 1rem !important;
    font-size: 0.875rem;
    line-height: 1.5;
}

.pending-signout {
    margin: 0;
    text-align: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color, #e5e8e1);
}

.pending-signout .btn-link {
    font-size: 0.875rem;
}

.profile-gate {
    max-width: 440px;
    margin: 0 auto;
    padding: 0.5rem 1rem 1.5rem;
}

.profile-gate-card {
    text-align: left;
}

.profile-gate-pill {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 0 0 0.5rem;
}

.profile-gate-fields {
    margin: 1.25rem 0 1.5rem;
}

.profile-gate-club-wrap select {
    width: 100%;
}

.profile-gate-signout {
    margin-top: 1rem;
    text-align: center;
}

.profile-gate .btn-cta {
    width: 100%;
}

.renew-main {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.renew-card {
    max-width: 480px;
    text-align: center;
    padding: 2rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-secondary, #fff);
}

.renew-card h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.renew-lead {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.renew-cta {
    width: 100%;
    max-width: 320px;
    margin: 0 auto 1rem;
    display: inline-flex;
    justify-content: center;
}

.renew-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.renew-back a {
    color: var(--primary-color);
}

.insurance-confirm-group {
    margin: 1.25rem 0 1.5rem;
    text-align: left;
    max-width: 36rem;
    margin-left: auto;
    margin-right: auto;
}

.insurance-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--text-primary);
}

.insurance-checkbox-label input[type='checkbox'] {
    margin-top: 0.2rem;
    flex-shrink: 0;
    width: 1.1rem;
    height: 1.1rem;
}

.insurance-actions {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.insurance-sample-text {
    font-size: 0.95rem;
    line-height: 1.55;
    margin: 0;
}

.insurance-next-box {
    margin-top: 1rem;
}

.insurance-dashboard-link-wrap {
    margin: 0.75rem 0 0;
}

.magic-link-box {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    text-align: left;
}

.magic-link-intro {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: var(--text-primary, #222);
}

.magic-link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.magic-email-input {
    flex: 1 1 12rem;
    min-width: 0;
    padding: 0.5rem 0.65rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
}

.magic-link-hint {
    font-size: 0.8rem;
    color: #666;
    margin: 0.5rem 0 0;
    line-height: 1.4;
}

.login-hint.subtle {
    font-size: 0.85rem;
    color: #666;
}

.password-auth-box {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    text-align: left;
}

.password-auth-intro {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 0.65rem;
    color: var(--text-primary, #222);
}

.password-auth-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
    width: 100%;
    min-width: 0;
}

.password-auth-fields > div {
    min-width: 0;
}

.password-auth-fields label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #444;
    display: block;
    margin-bottom: 0.25rem;
}

.optional-label {
    font-weight: 400;
    color: #777;
}

.password-auth-input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 0.5rem 0.65rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px; /* avoid iOS zoom */
}

@media (min-width: 480px) {
    .password-auth-fields {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .password-auth-fields > div:nth-child(n + 3) {
        grid-column: 1 / -1;
    }
}

.password-auth-actions {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.password-auth-forgot {
    margin: 0.5rem 0 0;
    text-align: left;
    font-size: 0.875rem;
}

.password-forgot-panel {
    margin: 0.5rem 0 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color, #ddd);
    border-radius: var(--border-radius, 8px);
    text-align: left;
}

.password-auth-hint {
    font-size: 0.78rem;
    color: #666;
    margin: 0.35rem 0 0;
    line-height: 1.4;
}

/* Subtle code of conduct on entry */
.onboarding-entry-coc-line {
    text-align: center;
    font-size: 0.85rem;
    color: #666;
    margin: 1.75rem 0 0;
    line-height: 1.5;
}

.onboarding-entry-coc-line a {
    color: var(--primary-color, #2d5016);
    font-weight: 500;
}

/* Payment step: collapsible CoC + single checkbox */
.onboarding-coc-wrap {
    margin: 1.25rem 0 0;
    padding: 1rem 0 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.onboarding-coc-details {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.02);
    margin-bottom: 1rem;
    overflow: hidden;
}

.onboarding-coc-summary {
    padding: 0.65rem 0.9rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary, #222);
    list-style: none;
}

.onboarding-coc-summary::-webkit-details-marker {
    display: none;
}

.onboarding-coc-summary-hint {
    font-weight: 400;
    color: #777;
    font-size: 0.88rem;
}

.onboarding-coc-body {
    padding: 0 0.9rem 0.85rem;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #444;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.onboarding-coc-body ul {
    margin: 0.4rem 0 0.5rem;
    padding-left: 1.2rem;
}

.onboarding-coc-full-link {
    margin: 0.5rem 0 0;
    font-size: 0.88rem;
}

.onboarding-coc-check-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.92rem;
    line-height: 1.45;
    cursor: pointer;
    margin: 0;
}

.onboarding-coc-check-label input {
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.onboarding-coc-note {
    font-size: 0.85rem;
    color: #5a7a4a;
    margin: 0.5rem 0 0;
}
