/* ═══════════════════════════════════════════════
   MI CUENTA — Shared Styles
   ═══════════════════════════════════════════════ */

.mc-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 32px 24px 80px;
}

/* ── Page Header ──────────────────────────────── */

.mc-page-header {
    margin-bottom: 32px;
}

.mc-page-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.mc-page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #e8eaed;
    margin: 0 0 6px;
    letter-spacing: -0.02em;
}

.mc-page-desc {
    font-size: 0.875rem;
    color: #9aa0a6;
    margin: 0;
    line-height: 1.5;
}

/* ── Cards ────────────────────────────────────── */

.mc-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.mc-card:hover {
    border-color: rgba(255, 255, 255, 0.14);
}

.mc-card-empty {
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.12);
}

.mc-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px 0;
}

.mc-card-icon {
    font-size: 1.5rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.12);
    border-radius: 10px;
    flex-shrink: 0;
}

.mc-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #e8eaed;
    margin: 0;
}

.mc-card-subtitle {
    font-size: 0.8rem;
    color: #9aa0a6;
    margin: 3px 0 0;
}

.mc-card-body {
    padding: 20px 24px;
}

.mc-card-actions {
    padding: 0 24px 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ── Fields Grid ──────────────────────────────── */

.mc-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 32px;
}

.mc-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mc-field-full {
    grid-column: 1 / -1;
}

.mc-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #9aa0a6;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mc-value {
    font-size: 0.9375rem;
    color: #e8eaed;
    font-weight: 400;
}

/* ── Buttons ──────────────────────────────────── */

.mc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.mc-btn-primary {
    background: rgba(99, 102, 241, 0.85);
    color: #fff;
}

.mc-btn-primary:hover {
    background: rgba(99, 102, 241, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.mc-btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: #c4c9d0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mc-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e8eaed;
}

.mc-btn-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.mc-btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* ── Toggle Switches ─────────────────────────── */

.mc-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mc-toggle-row:last-child {
    border-bottom: none;
}

.mc-toggle-label {
    font-size: 0.9rem;
    color: #e8eaed;
    font-weight: 500;
    display: block;
}

.mc-toggle-desc {
    font-size: 0.775rem;
    color: #9aa0a6;
    display: block;
    margin-top: 2px;
}

.mc-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.mc-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mc-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    transition: 0.3s;
}

.mc-switch-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}

.mc-switch input:checked+.mc-switch-slider {
    background: rgba(99, 102, 241, 0.85);
}

.mc-switch input:checked+.mc-switch-slider::before {
    transform: translateX(20px);
}

/* API notification recipients */
#mc-notification-form .mc-notification-email-address {
    box-sizing: border-box;
    min-height: 38px;
    padding: 9px 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: #e8eaed;
    font: inherit;
    font-size: 0.875rem;
}

#mc-notification-form .mc-notification-email-address:focus {
    outline: 2px solid rgba(129, 140, 248, 0.75);
    outline-offset: 2px;
}

#mc-notification-form .mc-notification-recipient input[type="checkbox"] {
    accent-color: #818cf8;
    width: 17px;
    height: 17px;
}

#mc-notification-form .mc-switch input:focus-visible + .mc-switch-slider {
    outline: 2px solid #a5b4fc;
    outline-offset: 3px;
}

#mc-notification-fields:disabled {
    opacity: 0.6;
}

/* ── Table ────────────────────────────────────── */

.mc-table {
    width: 100%;
    border-collapse: collapse;
}

.mc-table th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: #9aa0a6;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mc-table td {
    padding: 12px;
    font-size: 0.875rem;
    color: #e8eaed;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.mc-table tr:last-child td {
    border-bottom: none;
}

.mc-table-empty {
    text-align: center;
    color: #9aa0a6 !important;
    padding: 32px 12px !important;
    font-style: italic;
}

/* ── Badges ───────────────────────────────────── */

.mc-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.mc-badge-active {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.mc-badge-inactive {
    background: rgba(255, 255, 255, 0.06);
    color: #9aa0a6;
}

/* ── Session Rows ─────────────────────────────── */

.mc-session-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}

.mc-session-device {
    font-size: 0.9rem;
    color: #e8eaed;
    font-weight: 500;
    display: block;
}

/* ── Addresses Grid ───────────────────────────── */

.mc-addresses-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ── Text Utilities ───────────────────────────── */

.mc-text-muted {
    font-size: 0.85rem;
    color: #9aa0a6;
    margin: 0;
    line-height: 1.6;
}

.mc-value-mono {
    font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    letter-spacing: 0.04em;
}

.mc-value-highlight {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mc-badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
    white-space: nowrap;
}

/* ── Credentials Grid ─────────────────────────── */

.mc-cred-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mc-cred-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mc-cred-item:last-child {
    border-bottom: none;
}

.mc-cred-icon {
    font-size: 1.3rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    flex-shrink: 0;
}

.mc-cred-info {
    flex: 1;
}

.mc-cred-label {
    font-size: 0.875rem;
    color: #e8eaed;
    font-weight: 500;
    display: block;
}

.mc-cred-status {
    font-size: 0.75rem;
    color: #9aa0a6;
    display: block;
    margin-top: 2px;
}

.mc-cred-status.mc-cred-ok {
    color: #4ade80;
}

.mc-btn-sm {
    padding: 6px 14px;
    font-size: 0.75rem;
}

.mc-btn-upload {
    cursor: pointer;
}

/* ── Upload Zone ──────────────────────────────── */

.mc-upload-zone {
    border: 2px dashed rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 36px 24px;
    text-align: center;
    transition: all 0.2s ease;
}

.mc-upload-zone:hover,
.mc-upload-zone--active {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(99, 102, 241, 0.04);
}

.mc-upload-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.mc-upload-text {
    font-size: 0.875rem;
    color: #c4c9d0;
    margin: 0 0 14px;
}

.mc-upload-hint {
    font-size: 0.7rem;
    color: #9aa0a6;
    margin: 12px 0 0;
}

.mc-upload-result {
    padding: 4px 0;
}

.mc-upload-file {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px 16px;
}

.mc-upload-file-icon {
    font-size: 1.25rem;
}

.mc-upload-file-name {
    flex: 1;
    font-size: 0.875rem;
    color: #e8eaed;
    font-weight: 500;
}

/* ── SweetAlert2 Form Overrides ───────────────── */

.mc-swal-popup {
    background: #1a1f2e !important;
    color: #e8eaed !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px !important;
}

.mc-swal-popup .swal2-title {
    color: #e8eaed !important;
}

.mc-swal-popup .swal2-confirm {
    background: rgba(99, 102, 241, 0.85) !important;
    border-radius: 8px !important;
}

.mc-swal-popup .swal2-cancel {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #c4c9d0 !important;
    border-radius: 8px !important;
}

.mc-swal-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: left;
    padding: 8px 0;
}

.mc-swal-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #9aa0a6;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.mc-swal-field .swal2-input,
.mc-swal-field .swal2-select {
    width: 100% !important;
    margin: 0 !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 8px !important;
    color: #e8eaed !important;
    font-size: 0.875rem !important;
    padding: 10px 12px !important;
    box-sizing: border-box;
}

.mc-swal-field .swal2-input::placeholder {
    color: #6b7280 !important;
}

.mc-swal-field .swal2-select option {
    background: #1a1f2e;
    color: #e8eaed;
}

.mc-swal-popup .swal2-input {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #e8eaed !important;
    border-radius: 8px !important;
}

.mc-swal-popup .swal2-input-label {
    color: #9aa0a6 !important;
}

/* ── Address Type Badges ─────────────────────── */

.mc-addr-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.mc-addr-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.mc-addr-badge--envio {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.mc-addr-badge--almacen {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.mc-addr-badge--fiscal {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

.mc-addr-badge--oficial {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.mc-card--oficial {
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.1);
}

/* ── Address Checkbox Group ──────────────────── */

.mc-addr-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
}

.mc-addr-check {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.mc-addr-check input[type="checkbox"] {
    accent-color: #6366f1;
    width: 16px;
    height: 16px;
}

/* ── Swal Form Rows ──────────────────────────── */

.mc-swal-row {
    display: flex;
    gap: 12px;
}

.mc-swal-row .mc-swal-field {
    flex: 1;
}

.mc-swal-row .mc-swal-field--sm {
    flex: 0 0 100px;
}

.mc-swal-popup--wide .swal2-html-container {
    max-height: 65vh;
    overflow-y: auto;
}

/* ── Responsive ───────────────────────────────── */

@media (max-width: 768px) {
    .mc-container {
        padding: 20px 16px 60px;
    }

    .mc-fields-grid {
        grid-template-columns: 1fr;
    }

    .mc-addresses-grid {
        grid-template-columns: 1fr;
    }

    .mc-page-header-row {
        flex-direction: column;
    }
}
