/*
 * Floor Cost Calculator v2.4 - Light Sleek Theme
 * Supports popup (modal) and inline modes.
 */

/* =====================
   Trigger button (popup mode)
   ===================== */
.fcc-trigger {
    display: inline-block;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: #1e293b;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.fcc-trigger:hover {
    background: #0f172a;
}

/* =====================
   Modal overlay (popup mode)
   ===================== */
.fcc-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.fcc-overlay.fcc-active {
    display: flex;
}

/* Modal box — min-height prevents shrink during loading */
.fcc-modal {
    position: relative;
    width: 100%;
    max-width: 560px;
    min-height: 820px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: fcc-fade-in 0.25s ease-out;
}

@keyframes fcc-fade-in {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Close button */
.fcc-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 10;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #94a3b8;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.fcc-close:hover {
    color: #1e293b;
    background: #f1f5f9;
}

/* =====================
   Calculator container (shared)
   ===================== */
.fcc-calculator {
    max-width: 560px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: #1e293b;
}

/* Inline mode — visible card styling */
.fcc-calculator.fcc-inline {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* =====================
   State visibility — controlled by JS via class on .fcc-calculator
   ===================== */
.fcc-calculator .fcc-form,
.fcc-calculator .fcc-results,
.fcc-calculator .fcc-loading {
    display: none;
}

.fcc-calculator.fcc-show-form .fcc-form       { display: block; }
.fcc-calculator.fcc-show-loading .fcc-loading  { display: flex; }
.fcc-calculator.fcc-show-results .fcc-results  { display: block; }

/* =====================
   Form
   ===================== */
.fcc-form {
    padding: 40px 36px 36px;
}

.fcc-title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 600;
    color: #1e293b;
}

.fcc-subtitle {
    margin: 0 0 28px;
    color: #64748b;
    font-size: 14px;
}

/* Fields */
.fcc-field {
    margin-bottom: 20px;
}

.fcc-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fcc-field .required {
    color: #ef4444;
}

.fcc-field input[type="text"],
.fcc-field input[type="email"],
.fcc-field input[type="number"],
.fcc-field select {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px;
    color: #1e293b;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    -webkit-appearance: none;
}

.fcc-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%2394a3b8'%3E%3Cpath d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.fcc-field input::placeholder {
    color: #94a3b8;
}

.fcc-field input:focus,
.fcc-field select:focus {
    outline: none;
    border-color: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.15);
}

/* Consent checkbox */
.fcc-consent label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400;
    font-size: 13px;
    line-height: 1.5;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    color: #64748b;
}

.fcc-consent input[type="checkbox"] {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: #4ade80;
}

/* Submit button */
.fcc-submit {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: #1e293b;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.fcc-submit:hover {
    background: #0f172a;
}

/* Error message */
.fcc-error {
    margin-top: 15px;
    padding: 12px 15px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    border-radius: 6px;
    font-size: 14px;
}

/* =====================
   Loading
   ===================== */
.fcc-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 780px;
    font-size: 16px;
    color: #64748b;
}

.fcc-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e2e8f0;
    border-top-color: #1e293b;
    border-radius: 50%;
    animation: fcc-spin 0.8s linear infinite;
}

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

/* =====================
   Results
   ===================== */
.fcc-results {
    padding: 40px 36px 36px;
}

.fcc-results-title {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 600;
    color: #1e293b;
}

.fcc-results-summary {
    margin: 0 0 28px;
    font-size: 14px;
    color: #64748b;
}

/* Chart groups */
.fcc-chart-group {
    margin-bottom: 24px;
}

.fcc-chart-group h3 {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Bar rows */
.fcc-bar-row {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    gap: 10px;
}

.fcc-bar-label {
    width: 80px;
    flex-shrink: 0;
    font-size: 13px;
    color: #94a3b8;
    text-align: right;
}

.fcc-bar-track {
    flex: 1;
    height: 28px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
}

.fcc-bar {
    height: 100%;
    border-radius: 4px;
    min-width: 2px;
}

.fcc-bar-byte {
    background: #cbd5e1;
}

.fcc-bar-reno {
    background: #4ade80;
}

.fcc-bar-value {
    width: 120px;
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
}

/* Savings summary */
.fcc-savings-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 28px 0;
}

.fcc-savings-3col {
    grid-template-columns: 1fr 1fr 1fr;
}

.fcc-savings-item {
    padding: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-align: center;
}

.fcc-savings-highlight {
    border-color: rgba(74, 222, 128, 0.3);
    background: rgba(74, 222, 128, 0.05);
}

.fcc-savings-label {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.fcc-savings-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
}

.fcc-savings-highlight .fcc-savings-value {
    color: #16a34a;
}

/* Disclaimer */
.fcc-disclaimer {
    margin: 0 0 20px;
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
    font-style: italic;
}

/* Recalculate button */
.fcc-recalculate {
    width: 100%;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.fcc-recalculate:hover {
    color: #1e293b;
    border-color: #cbd5e1;
}

/* =====================
   Responsive
   ===================== */
@media (max-width: 480px) {
    .fcc-form,
    .fcc-results {
        padding: 28px 20px 24px;
    }

    .fcc-savings-summary {
        grid-template-columns: 1fr;
    }

    .fcc-savings-3col {
        grid-template-columns: 1fr;
    }

    .fcc-bar-label {
        width: 65px;
        font-size: 12px;
    }

    .fcc-bar-value {
        width: 90px;
        font-size: 12px;
    }

    .fcc-modal {
        max-height: 95vh;
    }
}
