/**
 * Root Calculator Styles
 * Localized styles for the Japanese root calculator
 *
 * @package Zipper
 */

.sqrtc-hidden,
.sqrtc-waiting[hidden] {
    display: none !important;
}

.sqrtc-intro {
    display: grid;
    gap: 10px;
}

.sqrtc-lead {
    margin: 0 0 4px;
    font-size: 15px;
    line-height: 1.6;
    color: #5f5a56;
}

.sqrtc-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
    transition: box-shadow 0.2s ease;
}

.sqrtc-section:hover {
    box-shadow: 0 2px 8px rgba(45, 42, 38, 0.1);
}

.sqrtc-section-title,
.sqrtc-subtitle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #2d2a26;
}

.sqrtc-section-title i,
.sqrtc-subtitle i {
    color: #d4af37;
}

.sqrtc-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 100%;
    box-sizing: border-box;
}

.sqrtc-input-label {
    font-size: 13px;
    font-weight: 600;
    color: #5f5a56;
}

.sqrtc-amount-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.sqrtc-select-row {
    align-items: center;
}

.sqrtc-amount-input,
.sqrtc-select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 12px 14px;
    font-size: 16px;
    font-weight: 500;
    color: #2d2a26;
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sqrtc-amount-input:hover,
.sqrtc-select:hover {
    border-color: #d4c67a;
}

.sqrtc-amount-input:focus,
.sqrtc-select:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.sqrtc-amount-input::placeholder {
    font-weight: 400;
    color: #c4c0bc;
}

.sqrtc-unit-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid #e8e4dc;
    background: #faf9f7;
    color: #5f5a56;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.sqrtc-input-hint {
    font-size: 13px;
    line-height: 1.5;
    color: #7a756d;
}

.sqrtc-preset-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sqrtc-preset-btn {
    padding: 9px 14px;
    border: 1px solid #e8e4dc;
    border-radius: 999px;
    background: #fff;
    color: #5f5a56;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sqrtc-preset-btn:hover,
.sqrtc-preset-btn.is-active {
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.12);
    color: #8a6500;
}

.sqrtc-btn-group {
    display: flex;
    gap: 8px;
}

.sqrtc-btn-group .tool-btn {
    flex: 1 1 0;
}

.sqrtc-tip-section {
    background: #fffdf9;
}

.sqrtc-tip-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 8px;
    color: #5f5a56;
    font-size: 14px;
    line-height: 1.6;
}

.sqrtc-waiting {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid #eadfb8;
    background: #fffaf0;
    color: #7a5d18;
}

.sqrtc-waiting i {
    color: #d4af37;
    font-size: 18px;
    margin-top: 2px;
}

.sqrtc-waiting p {
    margin: 0;
    line-height: 1.6;
}

.sqrtc-result-hero {
    display: grid;
    gap: 12px;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #eadfb8;
    background: linear-gradient(135deg, #fdfbf5 0%, #faf6ec 100%);
    box-shadow: 0 10px 24px rgba(212, 175, 55, 0.14);
}

.sqrtc-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sqrtc-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.sqrtc-status-badge.is-valid {
    background: rgba(70, 180, 80, 0.12);
    color: #267237;
}

.sqrtc-status-badge.is-neutral {
    background: rgba(212, 175, 55, 0.14);
    color: #8a6500;
}

.sqrtc-status-badge.is-warning {
    background: rgba(255, 185, 0, 0.16);
    color: #8a6500;
}

.sqrtc-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: #5f5a56;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sqrtc-copy-btn:hover,
.sqrtc-copy-btn:focus {
    outline: none;
    border-color: #d4af37;
    color: #8a6500;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

.sqrtc-hero-expression {
    font-size: 14px;
    font-weight: 600;
    color: #8a6500;
}

.sqrtc-hero-value {
    font-size: clamp(32px, 5vw, 46px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: #2d2a26;
}

.sqrtc-hero-label {
    font-size: 14px;
    font-weight: 600;
    color: #5f5a56;
}

.sqrtc-hero-summary {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: #4a4640;
}

.sqrtc-formula-box {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.18);
    background: rgba(255, 255, 255, 0.78);
    font-size: 13px;
    line-height: 1.6;
    color: #5f5a56;
    word-break: break-word;
}

.sqrtc-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.sqrtc-kpi-card {
    display: grid;
    gap: 8px;
    min-width: 0;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #e8e4dc;
    background: #fff;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.05);
}

.sqrtc-kpi-label {
    font-size: 13px;
    font-weight: 600;
    color: #7a756d;
}

.sqrtc-kpi-value {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: #2d2a26;
    word-break: break-word;
}

.sqrtc-range-card {
    display: grid;
    gap: 12px;
}

.sqrtc-range-head,
.sqrtc-range-legend {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    line-height: 1.6;
    color: #5f5a56;
}

.sqrtc-range-track {
    overflow: hidden;
    height: 12px;
    border-radius: 999px;
    background: #f1ede5;
}

.sqrtc-range-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.sqrtc-table-wrap {
    max-width: 100%;
    overflow-x: auto;
}

.sqrtc-table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
}

.sqrtc-table th,
.sqrtc-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #efe9df;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
    line-height: 1.6;
}

.sqrtc-table th {
    width: 34%;
    color: #5f5a56;
    font-weight: 600;
}

.sqrtc-table td {
    color: #2d2a26;
    font-weight: 500;
}

.sqrtc-table tr:last-child th,
.sqrtc-table tr:last-child td {
    border-bottom: 0;
}

@media (max-width: 900px) {
    .sqrtc-kpi-value {
        font-size: 22px;
    }
}

@media (max-width: 768px) {
    .sqrtc-btn-group {
        display: grid;
        grid-template-columns: 1fr;
    }

    .sqrtc-result-hero {
        padding: 18px;
    }

    .sqrtc-range-head,
    .sqrtc-range-legend {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .sqrtc-section,
    .sqrtc-result-hero,
    .sqrtc-waiting {
        padding: 16px;
    }

    .sqrtc-amount-row {
        grid-template-columns: 1fr;
    }

    .sqrtc-unit-chip {
        justify-content: flex-start;
    }

    .sqrtc-hero-value {
        font-size: 30px;
    }

    .sqrtc-kpi-value {
        font-size: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sqrtc-section,
    .sqrtc-amount-input,
    .sqrtc-select,
    .sqrtc-copy-btn,
    .sqrtc-preset-btn {
        transition: none !important;
    }
}
