/* ==========================================================================
   Calculadoras SMD (Condensadores y Resistencias) - 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: 850px;
    width: 100%;
    background: white;
    padding: 30px;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    transition: all 0.2s;
}

.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;
}

.format-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 30px;
    background: #f8fafc;
    padding: 16px 20px;
    border-radius: 16px;
    align-items: center;
}

.format-selector label {
    font-weight: 500;
    color: #1e2a3a;
    margin-right: 6px;
}

.format-btn {
    padding: 8px 18px;
    border: 2px solid #dbe0e8;
    background: white;
    border-radius: 30px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: 0.15s;
    color: #1e2a3a;
}

.format-btn.active {
    background: #1e2a3a;
    border-color: #1e2a3a;
    color: white;
}

.format-btn:hover:not(.active) {
    border-color: #8a9bb5;
    background: #f1f4f9;
}

.code-visual {
    background: #f1f5f9;
    border-radius: 20px;
    padding: 24px 20px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80px;
}

.code-badge {
    background: #1e293b;
    color: white;
    padding: 12px 28px;
    border-radius: 60px;
    font-size: 28px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.code-badge .char-box {
    display: inline-block;
    min-width: 32px;
    text-align: center;
    background: #2d3a4f;
    padding: 0 6px;
    border-radius: 8px;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px 20px;
    background: #fafcff;
    padding: 22px 18px;
    border-radius: 20px;
    border: 1px solid #e9edf3;
    margin-bottom: 24px;
}

.control-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.control-item label {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.control-item select {
    padding: 10px 8px;
    border-radius: 12px;
    border: 1px solid #ced8e5;
    background: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.15s;
    appearance: auto;
}

.control-item select:focus {
    outline: 2px solid #3b82f6;
    border-color: transparent;
}

.result-box {
    background: #0b1e2f;
    color: white;
    padding: 18px 24px;
    border-radius: 18px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px 20px;
    margin-top: 6px;
}

.result-value {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.5px;
    font-family: 'Courier New', monospace;
    background: #1f3348;
    padding: 6px 18px;
    border-radius: 40px;
}

.result-detail {
    color: #b0c7df;
    font-size: 15px;
}

.result-detail strong {
    color: white;
    font-weight: 600;
}

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

.error-msg {
    color: #f87171;
    background: #451a1a;
    padding: 6px 14px;
    border-radius: 30px;
    font-weight: 500;
    display: none;
}

@media (max-width: 600px) {
    .container { padding: 16px; }
    .code-badge { font-size: 22px; padding: 8px 16px; }
    .code-badge .char-box { min-width: 24px; }
    .controls-grid { grid-template-columns: 1fr 1fr; }
    .result-value { font-size: 22px; }
}
