/* =========================================================
   Appliance Fit Check — Plugin Styles
   Version: 1.0.0
   ========================================================= */

/* ---- Variables ---- */
:root {
    --afc-blue:        #1a56db;
    --afc-blue-dark:   #1546b8;
    --afc-blue-light:  #e8f0fe;
    --afc-blue-header: #1a56db;
    --afc-white:       #ffffff;
    --afc-bg:          #f4f6fb;
    --afc-border:      #dde3ef;
    --afc-text:        #1c2a3a;
    --afc-text-muted:  #6b7a99;
    --afc-text-label:  #2d3e5f;
    --afc-radius:      10px;
    --afc-radius-sm:   6px;
    --afc-shadow:      0 4px 24px rgba(26,86,219,.10), 0 1px 4px rgba(26,86,219,.06);
    --afc-input-focus: 0 0 0 3px rgba(26,86,219,.18);

    /* Result colours */
    --afc-perfect:     #0a7a4a;
    --afc-perfect-bg:  #e6f7ef;
    --afc-tight:       #b45309;
    --afc-tight-bg:    #fef3e2;
    --afc-modify:      #c05400;
    --afc-modify-bg:   #fff0e6;
    --afc-nofit:       #b91c1c;
    --afc-nofit-bg:    #fde8e8;
}

/* ---- Wrapper ---- */
.afc-wrapper {
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    color: var(--afc-text);
    background: var(--afc-bg);
    border-radius: var(--afc-radius);
    box-shadow: var(--afc-shadow);
    max-width: 520px;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid var(--afc-border);
}

/* ---- Header ---- */
.afc-header {
    background: var(--afc-blue-header);
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 11px;
}

.afc-header-icon {
    width: 24px;
    height: 24px;
    color: rgba(255,255,255,.85);
    flex-shrink: 0;
}

.afc-header-title {
    margin: 0;
    font-size: 1.18rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: .01em;
}

/* ---- Body ---- */
.afc-body {
    padding: 20px 20px 24px;
}

/* ---- Steps ---- */
.afc-step {
    margin-bottom: 20px;
    animation: afc-fadeIn .28s ease;
}

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

.afc-step-label {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: .95rem;
    font-weight: 700;
    color: var(--afc-text-label);
    margin: 0 0 10px 0;
}

.afc-step-num {
    display: inline-block;
    background: var(--afc-blue);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: .04em;
    white-space: nowrap;
    flex-shrink: 0;
}

.afc-hint {
    font-size: .84rem;
    color: var(--afc-text-muted);
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.afc-hint-small {
    font-size: .78rem;
    margin-top: 6px;
    margin-bottom: 0;
}

/* ---- Select ---- */
.afc-select-wrapper {
    position: relative;
}

.afc-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background: var(--afc-white);
    border: 1.5px solid var(--afc-border);
    border-radius: var(--afc-radius-sm);
    font-size: .96rem;
    color: var(--afc-text);
    cursor: pointer;
    transition: border-color .18s, box-shadow .18s;
    font-family: inherit;
}

.afc-select:focus {
    outline: none;
    border-color: var(--afc-blue);
    box-shadow: var(--afc-input-focus);
}

.afc-select-chevron {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--afc-blue);
    pointer-events: none;
}

/* ---- Dimension Grid ---- */
.afc-dims-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.afc-dim-box {
    background: var(--afc-white);
    border: 1.5px solid var(--afc-border);
    border-radius: var(--afc-radius-sm);
    padding: 10px 10px 8px;
    transition: border-color .18s;
}

.afc-dim-box:focus-within {
    border-color: var(--afc-blue);
    box-shadow: var(--afc-input-focus);
}

.afc-dim-label {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    color: var(--afc-text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 5px;
}

.afc-dim-input-wrap {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.afc-input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--afc-text);
    font-family: inherit;
    padding: 0;
    -moz-appearance: textfield;
}

.afc-input::-webkit-outer-spin-button,
.afc-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.afc-input::placeholder {
    color: #c5ccda;
    font-weight: 400;
}

.afc-unit {
    font-size: .8rem;
    color: var(--afc-text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ---- Measuring tip ---- */
.afc-measure-tip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--afc-blue-light);
    border: 1px solid rgba(26,86,219,.15);
    border-radius: var(--afc-radius-sm);
    padding: 10px 14px;
    margin-top: 14px;
    font-size: .84rem;
    color: var(--afc-text-label);
}

.afc-measure-tip svg {
    width: 18px;
    height: 18px;
    color: var(--afc-blue);
    flex-shrink: 0;
}

.afc-measure-tip a {
    color: var(--afc-blue);
    font-weight: 600;
    text-decoration: none;
}

.afc-measure-tip a:hover {
    text-decoration: underline;
}

/* ---- Error ---- */
.afc-error {
    background: #fde8e8;
    border: 1px solid #f5a1a1;
    border-radius: var(--afc-radius-sm);
    padding: 11px 14px;
    margin-bottom: 14px;
    font-size: .88rem;
    color: var(--afc-nofit);
    font-weight: 500;
}

/* ---- Check Fit Button ---- */
.afc-btn-wrap {
    margin-top: 4px;
}

.afc-btn-check {
    display: block;
    width: 100%;
    background: var(--afc-blue);
    color: #fff;
    border: none;
    border-radius: var(--afc-radius-sm);
    padding: 15px;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    cursor: pointer;
    font-family: inherit;
    transition: background .18s, transform .1s, box-shadow .18s;
    box-shadow: 0 3px 10px rgba(26,86,219,.25);
}

.afc-btn-check:hover {
    background: var(--afc-blue-dark);
    box-shadow: 0 5px 16px rgba(26,86,219,.35);
}

.afc-btn-check:active {
    transform: scale(.98);
}

/* ---- Divider between sections ---- */
.afc-step + .afc-step {
    padding-top: 16px;
    border-top: 1px solid var(--afc-border);
}

/* ---- Result ---- */
.afc-result {
    animation: afc-fadeIn .32s ease;
}

.afc-result-badge {
    display: flex;
    align-items: center;
    gap: 14px;
    border-radius: var(--afc-radius);
    padding: 16px 18px;
    margin-bottom: 16px;
    border: 1.5px solid transparent;
}

/* Variants */
.afc-result-badge.afc-perfect {
    background: var(--afc-perfect-bg);
    border-color: rgba(10,122,74,.25);
}
.afc-result-badge.afc-tight {
    background: var(--afc-tight-bg);
    border-color: rgba(180,83,9,.22);
}
.afc-result-badge.afc-modify {
    background: var(--afc-modify-bg);
    border-color: rgba(192,84,0,.22);
}
.afc-result-badge.afc-nofit {
    background: var(--afc-nofit-bg);
    border-color: rgba(185,28,28,.22);
}

.afc-result-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.afc-perfect .afc-result-icon { background: var(--afc-perfect); color: #fff; }
.afc-tight   .afc-result-icon { background: var(--afc-tight);   color: #fff; }
.afc-modify  .afc-result-icon { background: var(--afc-modify);  color: #fff; }
.afc-nofit   .afc-result-icon { background: var(--afc-nofit);   color: #fff; }

.afc-result-label {
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.2;
}
.afc-perfect .afc-result-label { color: var(--afc-perfect); }
.afc-tight   .afc-result-label { color: var(--afc-tight);   }
.afc-modify  .afc-result-label { color: var(--afc-modify);  }
.afc-nofit   .afc-result-label { color: var(--afc-nofit);   }

/* ---- Clearance breakdown ---- */
.afc-clearance {
    background: var(--afc-white);
    border: 1.5px solid var(--afc-border);
    border-radius: var(--afc-radius-sm);
    padding: 14px 16px;
    margin-bottom: 18px;
}

.afc-clearance-title {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--afc-text-muted);
    margin: 0 0 12px 0;
}

.afc-clearance-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.afc-clearance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .9rem;
}

.afc-clr-dim {
    font-weight: 600;
    color: var(--afc-text-label);
    min-width: 56px;
}

.afc-clr-val {
    font-weight: 700;
    font-size: .95rem;
    min-width: 70px;
    text-align: right;
}

.afc-clr-tag {
    font-size: .76rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 20px;
    white-space: nowrap;
}

.afc-clr-tag.afc-perfect { background: var(--afc-perfect-bg); color: var(--afc-perfect); }
.afc-clr-tag.afc-tight   { background: var(--afc-tight-bg);   color: var(--afc-tight);   }
.afc-clr-tag.afc-modify  { background: var(--afc-modify-bg);  color: var(--afc-modify);  }
.afc-clr-tag.afc-nofit   { background: var(--afc-nofit-bg);   color: var(--afc-nofit);   }

/* ---- CTA ---- */
.afc-cta {
    background: var(--afc-blue);
    border-radius: var(--afc-radius-sm);
    padding: 18px 18px 16px;
    text-align: center;
    margin-bottom: 16px;
}

.afc-cta-text {
    color: #fff;
    font-size: .94rem;
    font-weight: 600;
    margin: 0 0 14px 0;
    line-height: 1.5;
}

.afc-cta-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.afc-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    color: var(--afc-blue);
    font-size: .88rem;
    font-weight: 700;
    text-decoration: none;
    padding: 9px 18px;
    border-radius: var(--afc-radius-sm);
    transition: background .16s, transform .1s;
    letter-spacing: .01em;
}

.afc-cta-btn svg {
    width: 18px;
    height: 18px;
    fill: var(--afc-blue);
    flex-shrink: 0;
}

.afc-cta-btn:hover {
    background: #eef2ff;
    transform: translateY(-1px);
    color: var(--afc-blue-dark);
}

/* ---- Reset button ---- */
.afc-reset-wrap {
    text-align: center;
}

.afc-btn-reset {
    background: transparent;
    border: 1.5px solid var(--afc-border);
    border-radius: var(--afc-radius-sm);
    padding: 10px 22px;
    font-size: .88rem;
    font-weight: 600;
    color: var(--afc-text-muted);
    cursor: pointer;
    font-family: inherit;
    transition: border-color .16s, color .16s, background .16s;
}

.afc-btn-reset:hover {
    border-color: var(--afc-blue);
    color: var(--afc-blue);
    background: var(--afc-blue-light);
}

/* ---- Responsive ---- */
@media (max-width: 400px) {
    .afc-body {
        padding: 16px 14px 20px;
    }
    .afc-dims-grid {
        gap: 8px;
    }
    .afc-dim-box {
        padding: 8px 8px 6px;
    }
    .afc-input {
        font-size: 1rem;
    }
    .afc-header {
        padding: 15px 16px;
    }
    .afc-cta-buttons {
        flex-direction: column;
        align-items: center;
    }
}
