/* =========================================================
   VSUN Solar Calculator
   Version: 2.0.1
   Varena Sun Energy
========================================================= */

/* =========================================================
   ROOT VARIABLES
========================================================= */

:root {

    --vsun-primary: #ffb000;
    --vsun-primary-dark: #e99a00;
    --vsun-primary-light: #fff7e3;

    --vsun-secondary: #0646b8;
    --vsun-secondary-dark: #03358d;
    --vsun-secondary-light: #eef5ff;

    --vsun-success: #198754;
    --vsun-success-dark: #146c43;
    --vsun-success-light: #eaf7f0;

    --vsun-text: #172033;
    --vsun-text-light: #64748b;

    --vsun-background: #ffffff;
    --vsun-surface: #f8fafc;

    --vsun-border: #e2e8f0;
    --vsun-border-dark: #cbd5e1;

    --vsun-danger: #dc2626;

    --vsun-radius-small: 10px;
    --vsun-radius-medium: 16px;
    --vsun-radius-large: 22px;

    --vsun-shadow-small:
        0 4px 14px rgba(15, 23, 42, 0.06);

    --vsun-shadow-medium:
        0 14px 35px rgba(15, 23, 42, 0.09);

    --vsun-shadow-large:
        0 22px 55px rgba(15, 23, 42, 0.12);

    --vsun-transition:
        all 0.25s ease;
}

/* =========================================================
   MAIN CALCULATOR
========================================================= */

#vsun-calculator {

    width: 100%;
    max-width: 850px;

    margin: 40px auto;

    background: var(--vsun-background);

    border: 1px solid rgba(226, 232, 240, 0.75);
    border-radius: var(--vsun-radius-large);

    box-shadow: var(--vsun-shadow-large);

    overflow: hidden;

    direction: rtl;

    animation: vsunFadeIn 0.35s ease;
}

/* =========================================================
   HEADER
========================================================= */

.vsun-header {

    display: flex;
    justify-content: space-between;
    align-items: center;

    min-height: 78px;

    padding: 16px 24px;

    background:
        linear-gradient(
            135deg,
            #f8fafc 0%,
            #f1f5f9 100%
        );

    border-bottom: 1px solid var(--vsun-border);
}

/* =========================================================
   PROGRESS
========================================================= */

.vsun-progress {

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 58px;
    height: 44px;

    padding: 0 14px;

    background: var(--vsun-success-light);

    border: 1px solid rgba(25, 135, 84, 0.1);
    border-radius: 12px;

    color: var(--vsun-success);

    font-size: 17px;
    font-weight: 800;

    direction: ltr;
}

/* =========================================================
   BACK BUTTON
========================================================= */

.vsun-back {

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 44px;

    padding: 10px 18px;

    background: var(--vsun-secondary);

    color: #ffffff;

    border: 0;
    border-radius: var(--vsun-radius-small);

    font-family: inherit;
    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    transition: var(--vsun-transition);
}

.vsun-back:hover {

    background: var(--vsun-secondary-dark);

    transform: translateY(-2px);

    box-shadow: 0 8px 18px rgba(6, 70, 184, 0.2);
}

.vsun-back:active {

    transform: translateY(0);
}

/* =========================================================
   CONTENT
========================================================= */

#vsun-content {

    min-height: 420px;

    padding: 40px;

    background: #ffffff;
}

/* =========================================================
   STEP
========================================================= */

.vsun-step {

    width: 100%;

    animation: vsunStepIn 0.3s ease;
}

.vsun-step-header {

    width: 100%;

    margin-bottom: 32px;

    text-align: center;
}

.vsun-step-header h2,
.vsun-title {

    margin: 0 0 12px;

    color: var(--vsun-text);

    font-family: inherit;
    font-size: clamp(24px, 3vw, 31px);
    font-weight: 850;
    line-height: 1.55;

    text-align: center;
}

.vsun-step-header p,
.vsun-subtitle {

    max-width: 650px;

    margin: 0 auto;

    color: var(--vsun-text-light);

    font-family: inherit;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.9;

    text-align: center;
}

/* =========================================================
   STEP 1 USAGE GRID
========================================================= */

.vsun-usage-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    width: 100%;
    align-items: stretch;
}

/* =========================================================
   STEP 1 CARDS
========================================================= */

.vsun-usage-card {
    position: relative;

    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;

    width: 100%;
    min-height: 142px;
    height: 100%;

    padding: 22px 24px;

    background: #ffffff;

    border: 2px solid var(--vsun-border);
    border-radius: var(--vsun-radius-medium);

    color: var(--vsun-text);

    font-family: inherit;
    text-align: right;

    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;

    transition: var(--vsun-transition);

    overflow: hidden;
}

.vsun-usage-card::before {
    content: "";

    position: absolute;

    top: 0;
    right: 0;

    width: 5px;
    height: 100%;

    background: transparent;

    transition: var(--vsun-transition);
}

.vsun-usage-card:hover {
    background: #ffffff;
    border-color: var(--vsun-primary);
    transform: translateY(-3px);
    box-shadow: var(--vsun-shadow-medium);
}

.vsun-usage-card:hover::before {
    background: var(--vsun-primary);
}

/* =========================================================
   CARD ICON
========================================================= */

.vsun-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: auto;
    height: auto;

    margin-left: 8px;

    background: transparent;
    border: 0;
    border-radius: 0;

    font-size: 24px;
    line-height: 1;

    vertical-align: middle;
}

/* =========================================================
   CARD TITLE
========================================================= */

.vsun-usage-card strong {

    display: block;

    color: var(--vsun-text);

    font-size: 17px;
    font-weight: 850;
    line-height: 1.6;
}

/* =========================================================
   CARD TITLE
========================================================= */

.vsun-usage-card strong {
    display: flex;
    align-items: center;

    width: 100%;

    margin-bottom: 8px;

    color: var(--vsun-text);

    font-size: 17px;
    font-weight: 850;
    line-height: 1.7;
}

/* قرار گرفتن آیکون کنار عنوان */
.vsun-usage-card .vsun-card-icon {
    order: -1;
}

/* =========================================================
   CARD DESCRIPTION
========================================================= */

.vsun-usage-card > span:not(.vsun-card-icon) {
    display: block;

    color: var(--vsun-text-light);

    font-size: 14px;
    font-weight: 400;
    line-height: 2;

    text-align: right;
}

/* =========================================================
   WIDE CARD
========================================================= */

.vsun-usage-card-wide {
    grid-column: 1 / -1;
    min-height: 165px;
}

/* =========================================================
   SELECTED CARD
========================================================= */

.vsun-usage-card.selected {
    background: #ffffff;

    border-color: var(--vsun-secondary);

    box-shadow:
        0 12px 28px rgba(6, 70, 184, 0.14);
}

.vsun-usage-card.selected::before {
    background: var(--vsun-secondary);
}

.vsun-usage-card.selected strong {
    color: var(--vsun-secondary);
}

.vsun-usage-card.selected .vsun-card-icon {
    background: transparent;
    border: 0;
    color: inherit;
    transform: none;
}

.vsun-usage-card.selected::after {
    content: "✓";

    position: absolute;

    top: 12px;
    left: 12px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 25px;
    height: 25px;

    background: var(--vsun-secondary);

    color: #ffffff;

    border-radius: 50%;

    font-size: 14px;
    font-weight: 900;
}

/* =========================================================
   KEYBOARD FOCUS
========================================================= */

.vsun-usage-card:focus-visible,
.choice:focus-visible,
.vsun-back:focus-visible {

    outline: 3px solid rgba(6, 70, 184, 0.22);
    outline-offset: 3px;
}

/* =========================================================
   GENERAL GRID FOR OTHER STEPS
========================================================= */

.vsun-grid {

    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 18px;

    width: 100%;
}

/* =========================================================
   GENERAL CHOICE BUTTON
========================================================= */

.choice {

    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 80px;

    padding: 18px;

    background: #ffffff;

    border: 2px solid var(--vsun-border);
    border-radius: var(--vsun-radius-medium);

    color: var(--vsun-text);

    font-family: inherit;
    font-size: 16px;
    font-weight: 750;
    line-height: 1.7;

    text-align: center;

    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;

    transition: var(--vsun-transition);
}

.choice:hover {

    border-color: var(--vsun-primary);

    transform: translateY(-3px);

    box-shadow: var(--vsun-shadow-small);
}

.choice.selected {

    background: var(--vsun-secondary);

    border-color: var(--vsun-secondary);

    color: #ffffff;

    box-shadow:
        0 10px 24px rgba(6, 70, 184, 0.18);
}

/* =========================================================
   HIDDEN INPUT
========================================================= */

#vsun-usage-category {

    display: none;
}

/* =========================================================
   START BUTTON
========================================================= */

#startCalculator {

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 50px;

    padding: 12px 24px;

    background:
        linear-gradient(
            135deg,
            var(--vsun-primary) 0%,
            #ffc126 100%
        );

    border: 0;
    border-radius: 13px;

    color: #ffffff;

    font-family: inherit;
    font-size: 16px;
    font-weight: 800;

    cursor: pointer;

    transition: var(--vsun-transition);
}

#startCalculator:hover {

    background:
        linear-gradient(
            135deg,
            var(--vsun-primary-dark) 0%,
            var(--vsun-primary) 100%
        );

    transform: translateY(-2px);

    box-shadow:
        0 10px 22px rgba(255, 176, 0, 0.25);
}

/* =========================================================
   TABLET
========================================================= */

@media screen and (max-width: 900px) {

    #vsun-calculator {

        width: calc(100% - 30px);

        margin: 30px auto;
    }

    #vsun-content {

        padding: 32px 26px;
    }

    .vsun-step-header h2,
    .vsun-title {

        font-size: 26px;
    }
}

/* =========================================================
   MOBILE
========================================================= */

@media screen and (max-width: 650px) {

    .vsun-usage-grid {
        grid-template-columns: 1fr;
        gap: 13px;
    }

    .vsun-usage-card-wide {
        grid-column: auto;
    }

    .vsun-usage-card {
        min-height: 125px;
        padding: 18px;
    }

    .vsun-usage-card-wide {
        min-height: 150px;
    }

    .vsun-card-icon {
        font-size: 22px;
    }

    .vsun-usage-card strong {
        font-size: 16px;
    }

    .vsun-usage-card > span:not(.vsun-card-icon) {
        font-size: 13.5px;
        line-height: 1.9;
    }
}

/* =========================================================
   VERY SMALL MOBILE
========================================================= */

@media screen and (max-width: 390px) {

    #vsun-content {

        padding: 24px 12px;
    }

    .vsun-usage-card {

        grid-template-columns: 42px 1fr;

        padding: 14px;

        column-gap: 10px;
    }

    .vsun-card-icon {

        width: 42px;
        height: 42px;

        font-size: 21px;
    }

    .vsun-usage-card strong {

        font-size: 15px;
    }

    .vsun-usage-card > span:not(.vsun-card-icon) {

        font-size: 12px;
    }
}

/* =========================================================
   ANIMATIONS
========================================================= */

@keyframes vsunFadeIn {

    from {

        opacity: 0;

        transform: translateY(14px);
    }

    to {

        opacity: 1;

        transform: translateY(0);
    }
}

@keyframes vsunStepIn {

    from {

        opacity: 0;

        transform: translateY(8px);
    }

    to {

        opacity: 1;

        transform: translateY(0);
    }
}

/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    #vsun-calculator,
    .vsun-step,
    .vsun-usage-card,
    .choice,
    .vsun-back,
    #startCalculator {

        animation: none;
        transition: none;
    }
}

/* =========================================================
   CARD HEADING STRUCTURE
========================================================= */

.vsun-card-heading {

    display: flex;
    align-items: center;

    width: 100%;

    margin-bottom: 10px;

    gap: 9px;
}

.vsun-card-heading .vsun-card-icon {

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: auto;
    height: auto;

    margin: 0;

    background: transparent;
    border: 0;

    font-size: 23px;
    line-height: 1;
}

.vsun-card-heading strong {

    display: inline-block;

    width: auto;

    margin: 0;

    font-size: 17px;
    line-height: 1.7;
}

.vsun-card-description {

    display: block;

    width: 100%;

    color: var(--vsun-text-light);

    font-size: 14.5px;
    line-height: 2;

    text-align: right;
}

.vsun-usage-card {

    justify-content: center;
}

.vsun-usage-card-wide {

    min-height: 170px;
}

.vsun-location-choice {

    gap: 10px;
}

.vsun-choice-icon {

    font-size: 23px;
    line-height: 1;
}

.vsun-error-message {

    grid-column: 1 / -1;

    margin: 20px 0;

    color: var(--vsun-danger);

    text-align: center;
}