/* ============================================
   MEJORAS FRONTEND - ETHICS PORTAL
   KIRO-PHX v2.0
   ============================================ */

/* 0. GLASSMORPHISM WRAPPER — full-width edge-to-edge */
.portal-tabs-wrapper {
    position: relative;
    background: linear-gradient(135deg, #eef4fa 0%, #e8f0f8 35%, #dde8f3 65%, #f4f8fc 100%);
    border-radius: 0;
    padding: 0;
    box-shadow: 0 8px 40px rgba(100, 116, 139, 0.12);
    overflow: hidden;
    width: 100%;
}
.portal-tabs-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 25% 40%, rgba(79,125,169,0.08) 0%, transparent 50%),
                radial-gradient(circle at 75% 70%, rgba(49,91,134,0.08) 0%, transparent 40%),
                radial-gradient(circle at 50% 20%, rgba(22,52,84,0.06) 0%, transparent 45%);
    animation: glassFloat 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}
@keyframes glassFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(1deg); }
    66% { transform: translate(-20px, 20px) rotate(-1deg); }
}
.portal-tabs-wrapper > * {
    position: relative;
    z-index: 1;
}

/* Section titles */
.portal-section-title {
    color: var(--ethics-text);
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
}
.portal-section-subtitle {
    color: var(--ethics-muted);
    font-size: 15px;
    margin: 0;
}

/* Override theme border on tab-content */
.style-1 .tabs-container .tab-content {
    border: none !important;
    border-top: none !important;
}

/* Reset style-1 — no longer the glassmorphism wrapper */
.portal-tabs-wrapper .style-1 {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    overflow: visible;
}
.portal-tabs-wrapper .style-1::before {
    display: none;
}

/* 1. PESTAÑAS — LIGHT GLASSMORPHISM */
.tabs-nav {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    float: none !important;
    width: 100%;
    gap: 15px;
    margin-bottom: 40px;
    padding: 20px 0;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.8) !important;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(100, 116, 139, 0.08);
}

.portal-tabs-wrapper .tabs-container {
    clear: both;
    display: block;
}

.portal-tabs-wrapper .tab-content {
    display: block;
    float: none;
    width: 100%;
}

.tabs-nav li {
    flex: 0 1 auto;
    margin: 0 !important;
    list-style: none;
}

.tabs-nav li a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 26px !important;
    min-width: 130px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(203, 213, 225, 0.6);
    border-radius: 12px;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(100, 116, 139, 0.06);
}

.tabs-nav li a:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(180, 35, 24, 0.34);
    box-shadow: 0 8px 25px rgba(180, 35, 24, 0.16);
}

.tabs-nav li.active a {
    background: linear-gradient(135deg, var(--ethics-primary) 0%, var(--ethics-secondary) 100%);
    border-color: rgba(180, 35, 24, 0.45);
    color: white !important;
    box-shadow: 0 10px 26px rgba(180, 35, 24, 0.22);
}

.tabs-nav li a i {
    font-size: 28px !important;
    margin-bottom: 8px;
    color: #64748b;
    transition: color 0.3s ease;
}

.tabs-nav li.active a i {
    color: white !important;
}

.tabs-nav li a:hover i {
    color: var(--ethics-secondary);
}

.tabs-nav li a h7 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: #475569;
    transition: color 0.3s ease;
}

.tabs-nav li.active a h7 {
    color: white !important;
}

.tabs-nav li a:hover h7 {
    color: var(--ethics-primary);
}

/* 2. FORMULARIOS — LIGHT GLASSMORPHISM CARDS */
.add-review-box {
    padding: 30px !important;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(100, 116, 139, 0.08);
}

.add-review-box h3 {
    margin-bottom: 15px !important;
    color: #1e293b;
    font-size: 24px;
    font-weight: 700;
}

.add-review-box .comment-notes {
    margin-bottom: 25px !important;
    color: #64748b;
    font-size: 15px;
    line-height: 1.6;
}

.add-review-box fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.add-review-box fieldset > div {
    margin-bottom: 20px;
}

.add-review-box label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #334155;
    font-size: 14px;
}

/* 3. INPUTS — LIGHT GLASSMORPHISM */
.comfort-input {
    width: 100%;
    padding: 12px 16px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    font-size: 15px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8) !important;
    color: #1e293b !important;
}

.comfort-input::placeholder {
    color: #94a3b8 !important;
}

.comfort-input:focus {
    border-color: var(--ethics-secondary) !important;
    background: #fff !important;
    box-shadow: 0 0 0 4px rgba(49, 91, 134, 0.12) !important;
    outline: none !important;
}

.comfort-input:disabled {
    background: #f1f5f9 !important;
    color: #94a3b8 !important;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Select dropdown */
.comfort-input option {
    background: #fff;
    color: #1e293b;
}

/* 4. BOTONES — LIGHT THEME */
.portal-tabs-wrapper .button {
    padding: 14px 32px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border-radius: 12px !important;
    transition: all 0.3s ease !important;
    border: none !important;
    cursor: pointer;
    background: linear-gradient(135deg, var(--ethics-primary) 0%, var(--ethics-secondary) 100%);
    color: white !important;
    box-shadow: 0 4px 15px rgba(180, 35, 24, 0.22);
}

.portal-tabs-wrapper .button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(180, 35, 24, 0.28);
}

.portal-tabs-wrapper .button:active {
    transform: translateY(0);
}

.portal-tabs-wrapper .button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* 5. LAYOUT DE BOTONES */
.form-buttons-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f1f5f9;
}

.form-buttons-left {
    flex: 0 0 auto;
}

.form-buttons-right {
    flex: 0 0 auto;
}

/* 6. PROGRESS STEPS — LIGHT GLASSMORPHISM */
.wizard-progress-custom {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 50px;
    padding: 24px 28px 54px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(100, 116, 139, 0.06);
}

.step-dot-custom {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 2;
}

.step-dot-custom.pending {
    background: #e2e8f0;
    color: #94a3b8;
    border: 2px solid #cbd5e1;
}

.step-dot-custom.current {
    background: linear-gradient(135deg, var(--ethics-primary) 0%, var(--ethics-secondary) 100%);
    color: white;
    border: 2px solid rgba(180, 35, 24, 0.4);
    box-shadow: 0 4px 20px rgba(180, 35, 24, 0.26);
    transform: scale(1.1);
}

.step-dot-custom.completed {
    background: linear-gradient(135deg, var(--ethics-primary) 0%, var(--ethics-secondary) 100%);
    color: white;
    border: 2px solid rgba(180, 35, 24, 0.34);
    box-shadow: 0 4px 15px rgba(180, 35, 24, 0.18);
}

.step-line-custom {
    flex: 1;
    height: 3px;
    margin: 0 10px;
    transition: all 0.3s ease;
    z-index: 1;
}

.step-line-custom.pending {
    background: #e2e8f0;
}

.step-line-custom.completed {
    background: linear-gradient(90deg, var(--ethics-primary) 0%, var(--ethics-secondary) 100%);
}

.step-label-custom {
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    color: var(--ethics-muted);
}

.step-dot-custom.current .step-label-custom {
    color: var(--ethics-primary);
    font-weight: 700;
}

.wizard-progress-custom.wizard-progress-wide {
    padding-left: 40px;
    padding-right: 40px;
}

/* Keep the step card and the form card visually aligned */
.portal-tabs-wrapper .tab-content > .row {
    margin-left: 0;
    margin-right: 0;
}

.portal-tabs-wrapper .tab-content > .row > [class*="col-"] {
    padding-left: 0;
    padding-right: 0;
}

/* 7. SWITCH DE PRIVACIDAD — LIGHT */
.privacy-switch {
    width: 52px;
    height: 28px;
    border-radius: 14px;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.08);
}

.privacy-switch.on {
    background: linear-gradient(135deg, var(--ethics-primary) 0%, var(--ethics-secondary) 100%);
    box-shadow: 0 2px 8px rgba(22, 52, 84, 0.26);
}

.privacy-switch.off {
    background: #cbd5e1;
}

.privacy-switch .knob {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    position: absolute;
    top: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.privacy-switch.on .knob {
    left: 26px;
}

.privacy-switch.off .knob {
    left: 2px;
}

/* 8. NOTIFICACIONES — LIGHT */
.portal-tabs-wrapper .notification {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
}

.portal-tabs-wrapper .notification.error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fecaca;
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

.portal-tabs-wrapper .notification.success {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #bbf7d0;
    border-left: 4px solid #22c55e;
    color: #166534;
}

.portal-tabs-wrapper .notification.success h5,
.portal-tabs-wrapper .notification.success h5 span {
    color: #15803d;
}

.portal-tabs-wrapper .notification.success p {
    color: #334155;
}

.portal-tabs-wrapper .notification.success p strong {
    color: #1e293b;
}

/* 9. HERO — PHOTO SLIDER POSITION FIX */
.main-search-container.plain-color .msps-container {
    top: 20px;
}

.main-search-container.plain-color .main-search-photo-slider {
    top: 13%;
}

/* 10. HEADER STICKY — TRANSICIÓN LENTA + SOMBRA DIFUMINADA */
.transparent-header #header:not(.cloned) {
    transition: all 0.6s ease-in-out !important;
}

#header {
    transition: all 0.6s ease-in-out !important;
}

#header.cloned {
    transition: all 0.6s ease-in-out !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 8px 30px rgba(0, 0, 0, 0.06) !important;
}

#header.cloned::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 0;
    right: 0;
    height: 15px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.06), transparent);
    pointer-events: none;
}

#header.cloned #navigation ul li a {
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* 11. BANNER ANÓNIMO — LIGHT */
.anon-banner {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #93c5fd;
    border-radius: 12px;
    padding: 16px 20px;
    margin-top: 12px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
}

.anon-banner p {
    margin: 0 0 12px 0;
    color: #1e40af;
    font-weight: 600;
    font-size: 14px;
}

.anon-banner .button {
    margin-right: 10px;
    padding: 10px 20px !important;
    font-size: 13px !important;
}

/* 12. ANIMACIONES SUAVES */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-content {
    animation: fadeIn 0.3s ease;
}

/* 12b. SIDEBAR & TEXT COLORS — LIGHT THEME */
.portal-tabs-wrapper .testimonial-author h4 {
    color: #1e293b;
}

.portal-tabs-wrapper .testimonial-author {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    width: 100%;
}

.portal-tabs-wrapper .testimonial-author h4 {
    width: 100%;
    margin: 0;
    text-align: center;
}

.portal-sidebar-badge {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(235, 241, 248, 0.94));
    border: 1px solid rgba(148, 163, 184, 0.24);
    box-shadow: 0 12px 24px rgba(73, 34, 30, 0.08);
}

.portal-sidebar-badge i {
    font-size: 28px;
    line-height: 1;
}

.portal-sidebar-badge.is-felicitacion i,
.portal-sidebar-badge.is-informacion i,
.portal-sidebar-badge.is-contacto i,
.portal-sidebar-badge.is-reclamo i {
    color: var(--ethics-primary);
}

.portal-sidebar-list {
    margin-left: 0;
}

.portal-tabs-wrapper .list-2 li {
    color: #475569;
}

.portal-tabs-wrapper .list-2.color li::before {
    color: var(--ethics-secondary);
}

.portal-tabs-wrapper .listing-desc-headline {
    color: #1e293b !important;
}

.portal-tabs-wrapper .sidebar-textbox {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
}

.portal-tabs-wrapper .contact-details li {
    color: #475569;
}

.portal-tabs-wrapper .contact-details li strong {
    color: #1e293b;
}

.portal-tabs-wrapper .contact-details li i {
    color: var(--ethics-secondary);
}

.portal-tabs-wrapper a:not(.button) {
    color: var(--ethics-secondary);
}

.portal-tabs-wrapper a:not(.button):hover {
    color: var(--ethics-primary);
}

/* Upload button */
.portal-tabs-wrapper .uploadButton-button {
    background: linear-gradient(135deg, var(--ethics-primary) 0%, var(--ethics-secondary) 100%);
    border: 1px solid transparent;
    color: #fff;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 12px 22px rgba(180, 35, 24, 0.16);
}

.portal-tabs-wrapper .uploadButton-button:hover {
    background: linear-gradient(135deg, var(--ethics-primary-dark) 0%, var(--ethics-primary) 100%);
    border-color: transparent;
    color: #fff;
}

.portal-tabs-wrapper .uploadButton-file-name {
    color: var(--ethics-muted);
}

.portal-tabs-wrapper .uploadButton {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.portal-tabs-wrapper .uploadButton-button {
    margin: 0 !important;
    min-width: 180px;
    text-align: center;
}

.portal-upload-row {
    width: 100%;
    margin-top: 4px;
}

.portal-upload-row > label {
    margin-bottom: 10px;
}

.portal-rut-help {
    display: block;
    margin-top: 6px;
    color: var(--ethics-muted);
    font-size: 12px;
    line-height: 1.4;
}

/* Field error on light bg */
.portal-tabs-wrapper .comfort-input.field-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.portal-tabs-wrapper .field-error-msg {
    color: #ef4444;
}

/* Form buttons container */
.portal-tabs-wrapper .form-buttons-container {
    border-top-color: #e2e8f0;
}

/* 13. RESPONSIVE */
@media (max-width: 768px) {
    .portal-tabs-wrapper {
        padding: 24px 16px 20px !important;
        border-radius: 16px;
    }
    .tabs-nav {
        flex-wrap: wrap;
        gap: 10px;
        padding: 15px 10px;
    }
    .tabs-nav li a {
        min-width: 100px;
        padding: 12px 18px !important;
    }
    .tabs-nav li a i { font-size: 24px !important; }
    .tabs-nav li a h7 { font-size: 12px; }
    .add-review-box {
        padding: 20px !important;
        margin-left: 0;
        margin-right: 0;
    }
    .form-buttons-container { flex-direction: column; gap: 15px; }
    .form-buttons-left, .form-buttons-right { width: 100%; }
    .portal-tabs-wrapper .button { width: 100%; }
    .wizard-progress-custom {
        margin-bottom: 34px;
        padding: 18px 12px 34px;
    }
    .step-dot-custom { width: 40px; height: 40px; font-size: 16px; }
    .step-label-custom { font-size: 10px; bottom: -20px; }
    .main-search-container.plain-color { padding-top: 90px !important; }
}

@media (max-width: 480px) {
    .tabs-nav li a { min-width: 80px; padding: 10px 12px !important; }
    .step-line-custom { margin: 0 5px; }
    .portal-tabs-wrapper { padding: 16px 10px 14px !important; }
}
