.torex-eps-calculator,
.torex-eps-calculator * {
    box-sizing: border-box;
}

.torex-eps-calculator {
    --torex-primary: #f2b705;
    --torex-primary-dark: #d99e00;
    --torex-dark: #171717;
    --torex-muted: #6b6b6b;
    --torex-line: #e7e7e7;
    --torex-surface: #f7f7f7;
    width: 100%;
    max-width: 1180px;
    margin: 32px auto;
    color: var(--torex-dark);
    font-family: inherit;
}

.torex-eps-calculator__header {
    max-width: 760px;
    margin-bottom: 30px;
}

.torex-eps-calculator__eyebrow,
.torex-eps-results__label {
    display: inline-block;
    margin-bottom: 10px;
    color: #8b6800;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.torex-eps-calculator__header h2 {
    margin: 0 0 12px;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.08;
    letter-spacing: -.03em;
}

.torex-eps-calculator__header p {
    margin: 0;
    color: var(--torex-muted);
    font-size: 17px;
    line-height: 1.65;
}

.torex-eps-calculator__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr);
    overflow: hidden;
    border: 1px solid var(--torex-line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .07);
}

.torex-eps-calculator__form {
    padding: clamp(24px, 4vw, 46px);
}

.torex-eps-field {
    margin: 0 0 24px;
    padding: 0;
    border: 0;
}

.torex-eps-field label,
.torex-eps-field legend {
    display: block;
    margin-bottom: 9px;
    color: var(--torex-dark);
    font-size: 14px;
    font-weight: 750;
}

.torex-eps-field > small {
    display: block;
    margin-top: 8px;
    color: var(--torex-muted);
    font-size: 12px;
    line-height: 1.45;
}

.torex-eps-input-wrap,
.torex-eps-select-wrap {
    position: relative;
}

.torex-eps-input-wrap input,
.torex-eps-select-wrap select {
    width: 100%;
    min-height: 54px;
    margin: 0;
    padding: 12px 58px 12px 16px;
    border: 1px solid #d7d7d7;
    border-radius: 10px;
    outline: none;
    background: #fff;
    color: var(--torex-dark);
    font: inherit;
    font-size: 16px;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.torex-eps-select-wrap select {
    appearance: none;
    cursor: pointer;
}

.torex-eps-select-wrap::after {
    position: absolute;
    top: 50%;
    right: 18px;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--torex-dark);
    border-bottom: 2px solid var(--torex-dark);
    content: "";
    pointer-events: none;
    transform: translateY(-70%) rotate(45deg);
}

.torex-eps-input-wrap span {
    position: absolute;
    top: 50%;
    right: 16px;
    color: var(--torex-muted);
    font-weight: 700;
    transform: translateY(-50%);
}

.torex-eps-input-wrap input:focus,
.torex-eps-select-wrap select:focus {
    border-color: var(--torex-primary-dark);
    box-shadow: 0 0 0 4px rgba(242, 183, 5, .16);
}

.torex-eps-input-wrap input.has-error {
    border-color: #c52b2b;
}

.torex-eps-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.torex-eps-option {
    position: relative;
    margin: 0 !important;
    cursor: pointer;
}

.torex-eps-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.torex-eps-option__box {
    display: flex;
    min-height: 88px;
    padding: 16px;
    border: 1px solid #d8d8d8;
    border-radius: 10px;
    flex-direction: column;
    justify-content: center;
    transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.torex-eps-option__box strong {
    margin-bottom: 4px;
    font-size: 15px;
}

.torex-eps-option__box small {
    color: var(--torex-muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
}

.torex-eps-option input:checked + .torex-eps-option__box {
    border-color: var(--torex-primary-dark);
    background: rgba(242, 183, 5, .10);
    box-shadow: inset 0 0 0 1px var(--torex-primary-dark);
}

.torex-eps-option input:focus-visible + .torex-eps-option__box {
    box-shadow: 0 0 0 4px rgba(242, 183, 5, .2);
}

.torex-eps-option.is-disabled {
    cursor: not-allowed;
    opacity: .48;
}

.torex-eps-field__message,
.torex-eps-error {
    min-height: 18px;
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.4;
}

.torex-eps-field__message {
    color: #7b5b00;
}

.torex-eps-error {
    color: #b42318;
    font-weight: 650;
}

.torex-eps-button {
    display: inline-flex;
    width: 100%;
    min-height: 56px;
    padding: 14px 24px;
    border: 0;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    background: var(--torex-primary);
    color: #151515;
    cursor: pointer;
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    transition: transform .15s ease, background-color .2s ease, box-shadow .2s ease;
}

.torex-eps-button:hover {
    background: #ffc518;
    box-shadow: 0 10px 22px rgba(242, 183, 5, .23);
    transform: translateY(-1px);
}

.torex-eps-button:active {
    transform: translateY(0);
}

.torex-eps-results {
    display: flex;
    min-height: 540px;
    padding: clamp(24px, 4vw, 46px);
    align-items: center;
    background: var(--torex-dark);
    color: #fff;
}

.torex-eps-results__placeholder,
.torex-eps-results__content {
    width: 100%;
}

.torex-eps-results__placeholder {
    text-align: center;
}

.torex-eps-results__icon {
    display: inline-flex;
    width: 58px;
    height: 58px;
    margin-bottom: 18px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    color: var(--torex-primary);
    font-size: 28px;
}

.torex-eps-results__placeholder h3 {
    margin: 0 0 10px;
    color: #fff;
    font-size: 22px;
}

.torex-eps-results__placeholder p {
    max-width: 360px;
    margin: 0 auto;
    color: rgba(255,255,255,.68);
    line-height: 1.6;
}

.torex-eps-results__main {
    display: flex;
    margin-bottom: 25px;
    align-items: baseline;
    gap: 10px;
}

.torex-eps-results__main strong {
    color: var(--torex-primary);
    font-size: clamp(48px, 7vw, 78px);
    line-height: 1;
    letter-spacing: -.05em;
}

.torex-eps-results__main span {
    font-size: 18px;
    font-weight: 700;
}

.torex-eps-results__details {
    display: grid;
    margin: 0 0 24px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid rgba(255,255,255,.13);
    border-left: 1px solid rgba(255,255,255,.13);
}

.torex-eps-results__details > div {
    padding: 14px;
    border-right: 1px solid rgba(255,255,255,.13);
    border-bottom: 1px solid rgba(255,255,255,.13);
}

.torex-eps-results__details dt {
    margin-bottom: 4px;
    color: rgba(255,255,255,.58);
    font-size: 11px;
    text-transform: uppercase;
}

.torex-eps-results__details dd {
    margin: 0;
    color: #fff;
    font-size: 15px;
    font-weight: 750;
}

.torex-eps-results__notice {
    margin-bottom: 22px;
    padding: 15px 16px;
    border-left: 3px solid var(--torex-primary);
    background: rgba(255,255,255,.07);
}

.torex-eps-results__notice strong {
    display: block;
    margin-bottom: 5px;
    color: var(--torex-primary);
    font-size: 13px;
}

.torex-eps-results__notice p {
    margin: 0;
    color: rgba(255,255,255,.76);
    font-size: 12px;
    line-height: 1.55;
}

.torex-eps-results__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff !important;
    font-size: 14px;
    font-weight: 750;
    text-decoration: none !important;
}

.torex-eps-results__link:hover {
    color: var(--torex-primary) !important;
}

.torex-eps-calculator__footnote {
    display: flex;
    margin-top: 18px;
    padding: 18px 20px;
    border: 1px solid var(--torex-line);
    border-radius: 12px;
    gap: 14px;
    background: var(--torex-surface);
}

.torex-eps-calculator__footnote strong {
    flex: 0 0 auto;
    font-size: 13px;
}

.torex-eps-calculator__footnote p {
    margin: 0;
    color: var(--torex-muted);
    font-size: 12px;
    line-height: 1.55;
}

@media (max-width: 820px) {
    .torex-eps-calculator__grid {
        grid-template-columns: 1fr;
    }

    .torex-eps-results {
        min-height: auto;
    }
}

@media (max-width: 520px) {
    .torex-eps-calculator {
        margin: 20px auto;
    }

    .torex-eps-calculator__grid {
        border-radius: 12px;
    }

    .torex-eps-options,
    .torex-eps-results__details {
        grid-template-columns: 1fr;
    }

    .torex-eps-calculator__footnote {
        display: block;
    }

    .torex-eps-calculator__footnote strong {
        display: block;
        margin-bottom: 6px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .torex-eps-calculator * {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
