/**
 * BFIT BaseLine Fitness - Subscription Form Styles
 * Requires: theme.css to be loaded first
 */

/* ============================================================================
   PAGE-SPECIFIC VARIABLES (extends theme.css)
   ============================================================================ */

:root {
    --container-max: 600px;
}

/* ============================================================================
   BASE STYLES
   ============================================================================ */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.6;
}

/* ============================================================================
   CONTAINER
   ============================================================================ */

.container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: var(--spacing-lg);
}

.form-container {
    width: 100%;
    max-width: var(--container-max);
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

/* ============================================================================
   HEADER
   ============================================================================ */

.form-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    padding: var(--spacing-xl);
    text-align: center;
    color: white;
}

.header-image {
    margin-bottom: var(--spacing-md);
}

.header-image img {
    max-width: 200px;
    height: auto;
}

.form-header h1 {
    font-family: var(--font-header);
    font-size: 1.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: var(--spacing-xs);
}

.form-header .subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 400;
}

/* ============================================================================
   FORM BODY
   ============================================================================ */

.form-body {
    padding: var(--spacing-xl);
}

/* ============================================================================
   PROGRESS BAR
   ============================================================================ */

.progress-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    position: relative;
    padding: 0 var(--spacing-sm);
}

.progress-line {
    position: absolute;
    top: 18px;
    left: 40px;
    right: 40px;
    height: 3px;
    background: var(--gray-200);
    z-index: 0;
}

.progress-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--color-primary);
    transition: width 0.4s ease;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
    cursor: default;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--gray-200);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: var(--spacing-xs);
    transition: all 0.3s ease;
}

.step-title {
    font-size: 0.7rem;
    color: var(--gray-400);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.progress-step.active .step-number {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 0 0 4px rgba(0, 128, 128, 0.2);
}

.progress-step.active .step-title {
    color: var(--color-primary);
}

.progress-step.completed .step-number {
    background: var(--color-success);
    color: white;
}

.progress-step.completed .step-title {
    color: var(--color-success);
}

/* ============================================================================
   ALERTS
   ============================================================================ */

.alert {
    display: none;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    font-size: 0.9rem;
    font-weight: 500;
}

.alert.show {
    display: block;
}

.alert-error {
    background: var(--color-error-bg);
    color: var(--color-error);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success-color);
    border: 1px solid rgba(22, 163, 74, 0.2);
}

/* ============================================================================
   LOADING STATE (Modal Overlay)
   ============================================================================ */

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.loading-overlay.show {
    display: flex;
}

.loading-modal {
    background: white;
    padding: var(--spacing-2xl) var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    text-align: center;
    max-width: 320px;
    width: 90%;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.loading-modal h3 {
    font-family: var(--font-header);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: var(--spacing-xs);
}

.loading-modal p {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin: 0;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--color-primary);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
    margin: 0 auto var(--spacing-lg);
}

.spinner-small {
    width: 24px;
    height: 24px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--color-primary);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
    margin: 0 auto var(--spacing-sm);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================================
   FORM PAGES
   ============================================================================ */

.form-page {
    display: none;
}

.form-page.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-page h2 {
    font-family: var(--font-header);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: var(--spacing-lg);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================================================
   FORM ELEMENTS
   ============================================================================ */

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.required {
    color: var(--color-error);
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    font-family: var(--font-body);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: white;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(0, 128, 128, 0.1);
}

.form-control.error {
    border-color: var(--color-error);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.error-message {
    display: none;
    color: var(--color-error);
    font-size: 0.8rem;
    margin-top: var(--spacing-xs);
}

.error-message.show {
    display: block;
}

/* ============================================================================
   RADIO OPTIONS
   ============================================================================ */

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.radio-option {
    flex: 1;
    min-width: 140px;
    position: relative;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.radio-option label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 16px;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    transition: all 0.2s ease;
}

.radio-option:hover label {
    border-color: var(--color-primary-light);
    background: rgba(0, 128, 128, 0.05);
}

.radio-option.selected label,
.radio-option input:checked + label {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

/* ============================================================================
   CONDITIONAL FIELDS
   ============================================================================ */

.conditional-field {
    display: none;
    overflow: hidden;
}

.conditional-field.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 200px; }
}

/* ============================================================================
   PLAN INFO CARD
   ============================================================================ */

.plan-info-card {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
}

.plan-info-header h3 {
    font-family: var(--font-header);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.plan-info-header p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0;
}

/* ============================================================================
   PRICING OPTIONS
   ============================================================================ */

.pricing-options {
    margin-bottom: var(--spacing-lg);
}

.pricing-loading,
.pricing-error,
.pricing-empty {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--gray-500);
}

.price-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--spacing-md);
}

.price-card {
    position: relative;
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.price-card:hover {
    border-color: var(--color-primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.price-card.selected {
    border-color: var(--color-primary);
    background: rgba(0, 128, 128, 0.05);
    box-shadow: 0 0 0 4px rgba(0, 128, 128, 0.1);
}

.price-card.popular {
    border-color: var(--color-accent);
}

.price-card.popular.selected {
    border-color: var(--color-primary);
}

.popular-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-accent);
    color: var(--gray-900);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-card-header {
    margin-bottom: var(--spacing-sm);
}

.price-duration {
    font-family: var(--font-header);
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-700);
    margin: 0;
}

.price-card-body {
    margin-bottom: var(--spacing-md);
}

.price-amount {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 2px;
}

.price-amount .currency {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-primary);
}

.price-amount .amount {
    font-family: var(--font-header);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-primary);
}

.price-description {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: var(--spacing-xs);
    display: none; /* Hide descriptions to keep cards clean */
}

.price-card-footer {
    margin-top: var(--spacing-sm);
}

.price-radio {
    display: none;
}

.price-select-btn {
    display: block;
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-primary);
    background: transparent;
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-card:hover .price-select-btn {
    background: var(--color-primary);
    color: white;
}

.price-card.selected .price-select-btn {
    background: var(--color-primary);
    color: white;
}

/* ============================================================================
   SUMMARY SECTION
   ============================================================================ */

.summary-section {
    background: var(--gray-50);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
}

.summary-section h3 {
    font-family: var(--font-header);
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--gray-200);
    padding-bottom: var(--spacing-sm);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--gray-200);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.summary-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-800);
}

.summary-total {
    background: var(--color-primary);
    margin: var(--spacing-md) calc(-1 * var(--spacing-lg));
    margin-bottom: calc(-1 * var(--spacing-lg));
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.summary-total .summary-label,
.summary-total .summary-value {
    color: white;
}

.price-highlight {
    font-size: 1.25rem !important;
    font-family: var(--font-header);
}

/* ============================================================================
   AGREEMENT SECTION
   ============================================================================ */

.agreement-section {
    margin-bottom: var(--spacing-lg);
    background: var(--gray-50);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
}

.agreement-section h3 {
    font-family: var(--font-header);
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--gray-200);
    padding-bottom: var(--spacing-sm);
}

.agreement-text {
    font-size: 0.8rem;
    color: var(--gray-500);
    text-align: center;
    line-height: 1.6;
}

/* Policy Checkboxes */
.policy-checkbox {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--gray-200);
    position: relative;
}

.policy-checkbox:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.policy-checkbox input[type="checkbox"] {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.policy-checkbox label {
    font-size: 0.85rem;
    color: var(--gray-600);
    line-height: 1.5;
    cursor: pointer;
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

.policy-checkbox label a {
    color: var(--color-primary);
    text-decoration: underline;
}

.policy-checkbox label a:hover {
    color: var(--color-primary-dark);
}

.policy-checkbox .error-message {
    position: absolute;
    bottom: 2px;
    left: 26px;
    font-size: 0.75rem;
}

/* Check All Wrapper */
.check-all-wrapper {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.policy-checkbox.check-all {
    background-color: #f8f9fa;
    border: 2px solid #008080;
}

.policy-checkbox.check-all label strong {
    color: #008080;
}

/* ============================================================================
   NAVIGATION BUTTONS
   ============================================================================ */

.form-navigation {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
}

.btn {
    flex: 1;
    padding: 14px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-body);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-200);
}

.btn-success {
    background: var(--color-success);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: var(--color-success-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 480px) {
    .container {
        padding: var(--spacing-sm);
    }

    .form-container {
        border-radius: var(--radius-md);
    }

    .form-header {
        padding: var(--spacing-lg);
    }

    .form-header h1 {
        font-size: 1.4rem;
    }

    .form-body {
        padding: var(--spacing-lg);
    }

    .progress-bar {
        margin-bottom: var(--spacing-lg);
    }

    .step-title {
        font-size: 0.6rem;
    }

    .step-number {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }

    .price-cards {
        grid-template-columns: 1fr 1fr;
    }

    .price-card {
        padding: var(--spacing-md);
    }

    .price-amount .amount {
        font-size: 1.4rem;
    }

    .radio-option {
        min-width: 100%;
    }

    .form-navigation {
        flex-direction: column-reverse;
    }
}
