/* ==========================================================================
   Calculadora de Potencia Eléctrica - ElectroWeb
   ========================================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1100px;
    width: 100%;
    background: white;
    padding: 30px;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.logo {
    text-align: center;
    margin-bottom: 20px;
}

.logo img {
    max-width: 180px;
    height: auto;
}

h1 {
    font-size: 26px;
    font-weight: 600;
    color: #1a2634;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.subhead {
    color: #4a5b6e;
    font-size: 15px;
    border-left: 4px solid #3b82f6;
    padding-left: 14px;
    margin-bottom: 28px;
    background: #f0f4ff;
    border-radius: 0 12px 12px 0;
    line-height: 1.5;
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: #f1f5f9;
    padding: 6px;
    border-radius: 16px;
}

.tab-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
    background: transparent;
    color: #4a5b6e;
}

.tab-btn.active {
    background: white;
    color: #1a2634;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.tab-btn:hover:not(.active) {
    background: rgba(255,255,255,0.5);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

.phase-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    background: #fafcff;
    padding: 20px;
    border-radius: 20px;
    border: 1px solid #e9edf3;
    margin-bottom: 20px;
}

.phase-box {
    background: white;
    border-radius: 16px;
    padding: 16px;
    border: 1px solid #e2e8f0;
}

.phase-box h3 {
    font-size: 15px;
    color: #2c3e50;
    margin-bottom: 12px;
    text-align: center;
    font-weight: 600;
}

.phase-box .input-group {
    margin-bottom: 10px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.input-group label {
    font-size: 12px;
    font-weight: 600;
    color: #4a5b6e;
    letter-spacing: 0.3px;
}

.input-group input {
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #ced8e5;
    font-size: 14px;
    font-weight: 500;
    width: 100%;
    transition: 0.15s;
}

.input-group input:focus {
    outline: 2px solid #3b82f6;
    border-color: transparent;
}

.input-group .unit {
    font-size: 11px;
    color: #6b7f94;
}

.general-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    background: #f8fafc;
    padding: 16px 20px;
    border-radius: 16px;
    margin-bottom: 20px;
    border: 1px dashed #dbe0e8;
}

.result-box {
    background: #0b1e2f;
    border-radius: 18px;
    padding: 20px 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px 24px;
    margin: 16px 0 8px;
}

.result-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.result-item .label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8aa3c0;
}

.result-item .value {
    font-size: 20px;
    font-weight: 700;
    color: white;
    font-family: 'Courier New', monospace;
}

.result-item .value.positive { color: #7dd3fc; }
.result-item .value.negative { color: #fca5a5; }
.result-item .value.warning { color: #fcd34d; }

.result-item .sub {
    font-size: 12px;
    color: #b0c7df;
}

.status-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 4px;
}

.status-badge.resistive {
    background: #1a3a4a;
    color: #7dd3fc;
}

.status-badge.inductive {
    background: #4a2a1a;
    color: #fca5a5;
}

.status-badge.capacitive {
    background: #1a3a2a;
    color: #6ee7b7;
}

.status-badge.balanced {
    background: #1a2a4a;
    color: #93b3e8;
}

.status-badge.unbalanced {
    background: #4a2a2a;
    color: #fca5a5;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    justify-content: center;
}

.btn {
    padding: 10px 28px;
    border: none;
    border-radius: 40px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: 0.15s;
    background: #eef2f6;
    color: #1e2a3a;
}

.btn-primary {
    background: #1e2a3a;
    color: white;
}

.btn-primary:hover {
    background: #2d3f55;
    transform: scale(1.02);
}

.btn-secondary {
    background: #e2e8f0;
}

.btn-secondary:hover {
    background: #d0d8e4;
}

.footer-note {
    margin-top: 24px;
    font-size: 13px;
    color: #5a6f84;
    text-align: center;
    border-top: 1px solid #e2e8f0;
    padding-top: 18px;
}

@media (max-width: 768px) {
    .container { padding: 16px; }
    .phase-grid { grid-template-columns: 1fr; }
    .result-box { grid-template-columns: 1fr 1fr; }
    .result-item .value { font-size: 17px; }
    .general-inputs { grid-template-columns: 1fr; }
}
