/**
 * Fairy Tale Forest Forms - Main Stylesheet
 */

/* ============================================
   Container & Base Styles
   ============================================ */

.ftf-form-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ============================================
   Header
   ============================================ */

.ftf-form-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 3px solid #6B4C9A;
}

.ftf-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 1rem;
}

.ftf-form-title {
    color: #6B4C9A;
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

/* ============================================
   Form Sections
   ============================================ */

.ftf-form-section {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: #fafafa;
    border-radius: 8px;
    border-left: 4px solid #6B4C9A;
}

.ftf-form-section h3 {
    color: #333;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e0e0e0;
}

/* Conditional sections */
.ftf-conditional-section {
    transition: all 0.3s ease;
}

/* Party Type Selection */
.ftf-party-type-section {
    background: linear-gradient(135deg, #f8f6fb 0%, #ffffff 100%);
    border-left-color: #6B4C9A;
}

.ftf-party-type-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* Meal Type Selection - Same styling as party type */
.ftf-meal-type-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.ftf-meal-type-card,
.ftf-party-type-card {
    position: relative;
    display: block;
    cursor: pointer;
}

.ftf-meal-type-card input[type="radio"],
.ftf-party-type-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.ftf-meal-type-content,
.ftf-party-type-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    background: #fff;
    border: 3px solid #ddd;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
    min-height: 200px;
    gap: 0.75rem;
}

.ftf-meal-type-card:hover .ftf-meal-type-content,
.ftf-party-type-card:hover .ftf-party-type-content {
    border-color: #6B4C9A;
    background: #f8f6fb;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(107, 76, 154, 0.2);
}

.ftf-meal-type-card input[type="radio"]:checked + .ftf-meal-type-content,
.ftf-party-type-card input[type="radio"]:checked + .ftf-party-type-content {
    border-color: #6B4C9A;
    background: linear-gradient(135deg, #6B4C9A 0%, #8B6CB8 100%);
    color: #fff;
    box-shadow: 0 10px 30px rgba(107, 76, 154, 0.4);
    transform: scale(1.02);
}

.ftf-meal-type-title,
.ftf-party-type-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
    display: block;
}

.ftf-meal-type-price,
.ftf-party-type-price {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    display: block;
}

.ftf-meal-type-card input[type="radio"]:checked + .ftf-meal-type-content .ftf-meal-type-price,
.ftf-party-type-card input[type="radio"]:checked + .ftf-party-type-content .ftf-party-type-price {
    color: #fff;
}

.ftf-meal-type-desc,
.ftf-party-type-desc {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #666;
    display: block;
}

.ftf-meal-type-card input[type="radio"]:checked + .ftf-meal-type-content .ftf-meal-type-desc,
.ftf-party-type-card input[type="radio"]:checked + .ftf-party-type-content .ftf-party-type-desc {
    color: rgba(255, 255, 255, 0.95);
}

/* ============================================
   Form Rows & Groups
   ============================================ */

.ftf-form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.ftf-form-group {
    flex: 1;
    min-width: 200px;
    padding-bottom: 20px;
}

.ftf-form-group.ftf-full-width {
    flex: 0 0 100%;
}

.ftf-form-group.ftf-half-width {
    flex: 0 0 calc(50% - 0.75rem);
}

.ftf-form-group.ftf-third-width {
    flex: 0 0 calc(33.333% - 1rem);
}

.ftf-form-group.ftf-quarter-width {
    flex: 0 0 calc(25% - 1.125rem);
}

.ftf-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.ftf-form-group small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

/* ============================================
   Input Fields
   ============================================ */

.ftf-form input[type="text"],
.ftf-form input[type="email"],
.ftf-form input[type="tel"],
.ftf-form input[type="date"],
.ftf-form input[type="number"],
.ftf-form select,
.ftf-form textarea {
    width: 100%;
    padding: 0.4rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #fff;
}

/* Custom dropdown arrow for select elements */
.ftf-form select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;charset=UTF-8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"%3E%3Cpath fill="%236B4C9A" d="M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z"/%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

.ftf-form input[type="text"]:focus,
.ftf-form input[type="email"]:focus,
.ftf-form input[type="tel"]:focus,
.ftf-form input[type="date"]:focus,
.ftf-form input[type="number"]:focus,
.ftf-form select:focus,
.ftf-form textarea:focus {
    outline: none;
    border-color: #6B4C9A;
    box-shadow: 0 0 0 3px rgba(107, 76, 154, 0.1);
}

.ftf-form input[type="number"] {
    max-width: 120px;
}

/* ============================================
   Radio Buttons
   ============================================ */

.ftf-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ftf-radio-label {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ftf-radio-label:hover {
    border-color: #6B4C9A;
    background: #f8f6fb;
}

.ftf-radio-label input[type="radio"] {
    margin-right: 0.75rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.ftf-radio-label input[type="radio"]:checked + span {
    font-weight: 600;
    color: #6B4C9A;
}

/* ============================================
   Radio Cards (Theme Selection)
   ============================================ */

.ftf-theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.ftf-radio-card {
    position: relative;
    display: block;
    cursor: pointer;
}

.ftf-radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.ftf-radio-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    background: #fff;
    border: 3px solid #ddd;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
    min-height: 100px;
}

.ftf-radio-card:hover .ftf-radio-card-content {
    border-color: #6B4C9A;
    background: #f8f6fb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 76, 154, 0.15);
}

.ftf-radio-card input[type="radio"]:checked + .ftf-radio-card-content {
    border-color: #6B4C9A;
    background: linear-gradient(135deg, #6B4C9A 0%, #8B6CB8 100%);
    color: #fff;
    box-shadow: 0 6px 16px rgba(107, 76, 154, 0.3);
}

.ftf-radio-card-content strong {
    font-size: 1rem;
    font-weight: 700;
    display: block;
    margin-bottom: 0.25rem;
}

.ftf-radio-card-content small {
    font-size: 0.8rem;
    opacity: 0.85;
}

/* ============================================
   Checkboxes
   ============================================ */

.ftf-checkbox-label {
    display: flex;
    align-items: flex-start;
    padding: 0.75rem;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 0.75rem;
}

.ftf-checkbox-label:hover {
    border-color: #6B4C9A;
    background: #f8f6fb;
}

.ftf-checkbox-label input[type="checkbox"] {
    margin-right: 0.75rem;
    margin-top: 0.25rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.ftf-checkbox-label input[type="checkbox"]:checked + span {
    font-weight: 600;
    color: #6B4C9A;
}

.ftf-checkbox-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ftf-highlighted-option {
    background: #fff7e6;
    border-color: #ffa726;
}

.ftf-highlighted-option:hover {
    border-color: #ff9800;
    background: #fff3e0;
}

/* ============================================
   Add-On Options
   ============================================ */

.ftf-addon-option {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: #e8f5e9;
    border: 2px solid #66bb6a;
    border-radius: 8px;
}

.ftf-addon-option label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #2e7d32;
}

.ftf-addon-option input[type="number"] {
    margin-top: 0.5rem;
}

.ftf-addon-highlight {
    padding: 1.5rem;
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8f4 100%);
    border: 3px solid #66bb6a;
    border-radius: 8px;
}

.ftf-addon-highlight p {
    margin: 0 0 1rem 0;
    color: #1b5e20;
    line-height: 1.6;
}

/* ============================================
   Payment/Calculation Display
   ============================================ */

.ftf-payment-section {
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
    border-left-color: #2e7d32;
}

/* Itemized Breakdown */
.ftf-itemized-breakdown {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    margin-bottom: 1.5rem;
}

.ftf-itemized-breakdown h4 {
    margin: 0 0 1rem 0;
    color: #6B4C9A;
    font-size: 1.1rem;
    font-weight: 700;
}

.ftf-itemized-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ftf-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #6B4C9A;
}

.ftf-item-name {
    font-weight: 500;
    color: #333;
}

.ftf-item-price {
    font-weight: 700;
    color: #2e7d32;
    font-size: 1.05rem;
}

.ftf-empty-cart {
    text-align: center;
    color: #999;
    font-style: italic;
    margin: 1rem 0;
}

/* Calculation Display */
.ftf-calculation-display {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.ftf-calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 1rem;
}

.ftf-calc-row:last-child {
    border-bottom: none;
}

.ftf-calc-total {
    background: #f8f6fb;
    margin: 0.5rem -1rem 0.5rem -1rem;
    padding: 1rem 1rem;
    border-top: 2px solid #6B4C9A;
    border-bottom: 2px solid #6B4C9A;
    font-size: 1.25rem;
}

.ftf-calc-deposit {
    background: #fff7e6;
    margin: 0.5rem -1rem 0.5rem -1rem;
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: #e65100;
}

/* ============================================
   Terms Box
   ============================================ */

.ftf-terms-box {
    padding: 1.25rem;
    background: #fff;
    border: 2px solid #ff9800;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.ftf-terms-box p {
    margin: 0;
    line-height: 1.6;
    color: #333;
    font-size: 0.95rem;
}

/* Info boxes (tax messages, notifications) */
.ftf-info-box {
    padding: 1rem;
    background: #fff7e6;
    border-left: 4px solid #ffa726;
    border-radius: 6px;
}

/* ============================================
   Signature Pad
   ============================================ */

.ftf-signature-wrapper {
    max-width: 600px;
    margin: 0 auto;
}

.ftf-signature-pad {
    width: 100%;
    height: 200px;
    border: 3px solid #6B4C9A;
    border-radius: 8px;
    background: #fff;
    cursor: crosshair;
    touch-action: none;
}

.ftf-clear-signature {
    margin-top: 1rem;
    display: block;
}

.ftf-signature-required {
    margin-top: 0.5rem;
    color: #d32f2f;
    font-size: 0.9rem;
    font-weight: 600;
}

/* ============================================
   Buttons
   ============================================ */

.ftf-btn {
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ftf-btn-primary {
    background: linear-gradient(135deg, #6B4C9A 0%, #8B6CB8 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(107, 76, 154, 0.3);
}

.ftf-btn-primary:hover {
    background: linear-gradient(135deg, #5a3d82 0%, #7a5ba0 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(107, 76, 154, 0.4);
}

.ftf-btn-primary:active {
    transform: translateY(0);
}

.ftf-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.ftf-btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 2px solid #ddd;
}

.ftf-btn-secondary:hover {
    background: #e0e0e0;
    border-color: #bdbdbd;
}

.ftf-submit-section {
    text-align: center;
    background: transparent;
    border: none;
    padding: 2rem 0 0 0;
}

/* ============================================
   Response Messages
   ============================================ */

.ftf-form-response {
    padding: 1.25rem;
    border-radius: 8px;
    margin-top: 2rem;
    font-weight: 600;
    text-align: center;
}

.ftf-form-response.ftf-success {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.ftf-form-response.ftf-error {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    .ftf-form-container {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .ftf-form-title {
        font-size: 1.5rem;
    }
    
    .ftf-form-section h3 {
        font-size: 1.1rem;
    }
    
    .ftf-form-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .ftf-form-group.ftf-half-width,
    .ftf-form-group.ftf-third-width,
    .ftf-form-group.ftf-quarter-width {
        flex: 0 0 100%;
    }
    
    /* Party type cards stack on mobile */
    .ftf-party-type-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .ftf-party-type-content {
        min-height: 160px;
        padding: 1.5rem;
    }
    
    .ftf-party-type-title {
        font-size: 1.25rem;
    }
    
    .ftf-party-type-price {
        font-size: 1.1rem;
    }
    
    .ftf-theme-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.75rem;
    }
    
    .ftf-radio-card-content {
        padding: 1rem 0.75rem;
        min-height: 80px;
    }
    
    .ftf-calc-row {
        font-size: 0.9rem;
    }
    
    .ftf-calc-total {
        font-size: 1.1rem;
    }
    
    .ftf-btn {
        width: 100%;
        padding: 1rem;
    }
    
    /* Itemized list mobile styles */
    .ftf-item-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .ftf-item-price {
        align-self: flex-end;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .ftf-form-container {
        padding: 1rem;
    }
    
    .ftf-logo {
        max-width: 150px;
    }
    
    .ftf-form-title {
        font-size: 1.25rem;
    }
    
    .ftf-theme-grid {
        grid-template-columns: 1fr;
    }
    
    .ftf-signature-pad {
        height: 150px;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .ftf-btn,
    .ftf-clear-signature {
        display: none;
    }
    
    .ftf-form-container {
        box-shadow: none;
    }
}

/* ============================================
   Addon Removal & Highlighting
   ============================================ */

.ftf-remove-addon {
    margin-left: 0.75rem;
    padding: 0.3rem 0.6rem;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.ftf-remove-addon:hover {
    background: #cc0000;
    transform: scale(1.05);
}

.ftf-item-addon {
    background: #fff7e6 !important;
    border-left-color: #ffa726 !important;
}

.ftf-item-free {
    background: #e8f5e9 !important;
    border-left-color: #66bb6a !important;
}

.ftf-item-divider {
    height: 2px;
    background: linear-gradient(to right, #6B4C9A, transparent);
    margin: 1rem 0;
}

@media (max-width: 768px) {
    .ftf-remove-addon {
        display: block;
        margin: 0.5rem 0 0 0;
        width: auto;
    }
}
