:root {
    --primary: #0f172a; /* Sophisticated Slate Blue */
    --primary-light: #334155;
    --primary-gradient: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    --secondary: #d4af37; /* Gold accent */
    --accent: #f59e0b;
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --sidebar-bg: #1e3a8a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 250px;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, #172554 100%);
    color: white;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3.5rem;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: var(--secondary);
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: 800; /* Bolder */
    font-size: 1rem; /* Slightly smaller for elegance */
    color: #1e3a8a; /* Deep blue text over gold */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-main {
    font-weight: 700;
    font-size: 1.15rem;
    line-height: 1.1;
    color: #ffffff; /* Contrast fix */
    letter-spacing: -0.01em;
}

.logo-sub {
    font-size: 0.7rem;
    opacity: 0.75;
    color: #cbd5e1; /* Sophisticated light blue-grey */
    font-weight: 500;
    letter-spacing: 0.02em;
}

.nav-menu {
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    opacity: 1;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-item i {
    width: 20px;
}

.confidential-badge {
    margin-top: auto;
    background: rgba(255, 255, 255, 0.05);
    padding: 1.25rem;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.confidential-badge i {
    color: #10b981;
    width: 20px;
}

/* Main Content Styling */
.main-content {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.top-bar {
    max-width: 900px;
    width: 100%;
    margin-bottom: 1.5rem;
}

.top-bar h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.top-bar p {
    color: var(--text-muted);
}

.form-wrapper {
    max-width: 950px;
    width: 100%;
    background: var(--bg-card);
    padding: 1.5rem 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px -12px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
}

.step-header {
    margin-bottom: 1.25rem;
}

.step-indicator {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.5rem;
}

.step-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.optional-label {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.form-step {
    display: none;
    animation: slideIn 0.4s ease-out;
}

.form-step.active {
    display: block;
}

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

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.form-group.full {
    grid-column: span 2;
}

/* Row/Col Utilities */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.75rem;
    margin-left: -0.75rem;
    width: calc(100% + 1.5rem);
}

.col-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

.year-input span {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.date-triple-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 0.75rem;
    width: 100%;
}

@media (max-width: 480px) {
    .date-triple-grid {
        grid-template-columns: 1fr 1.5fr 1fr;
    }
}

.ubigeo-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1.5rem !important;
    width: 100% !important;
    margin-bottom: 1rem;
}

.ubigeo-grid .form-group {
    grid-column: auto !important; /* Ensure no spanning override */
    min-width: 0;
}

@media (max-width: 600px) {
    .ubigeo-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

input, select, textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.8);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.08);
    transform: translateY(-1px);
}

/* Hide Spinners (Arrows) in Number Inputs */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number] {
    -moz-appearance: textfield;
}

/* Validation Highlights */
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

.form-group.has-error label {
    color: #ef4444 !important;
}

.error-message {
    font-size: 0.75rem;
    color: #ef4444;
    font-weight: 500;
    margin-top: 0.25rem;
    display: none;
}

.form-group.has-error .error-message {
    display: block;
}

.input-with-action {
    display: flex;
    gap: 0.75rem;
}

.btn-verify {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-verify:hover {
    background: #1e40af;
    transform: translateY(-1px);
}

/* Step Columns Layout */
.step-columns {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
}

.col-left {
    flex: 0 0 320px; /* Reduced for compactness */
}

.col-right {
    flex: 1;
}

@media (max-width: 1024px) {
    .step-columns {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .col-left, .col-right {
        width: 100%;
        flex: none;
    }
}

/* Premium Profile Upload Card */
.profile-upload-card {
    background: linear-gradient(180deg, #4285f4 0%, #2b6cb0 100%);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 10px 30px rgba(66, 133, 244, 0.15);
    max-width: 100%;
}

.profile-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid white;
    overflow: hidden;
    background: #fff;
    display: grid;
    place-items: center;
}

.profile-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.upload-dropzone {
    background: rgba(255, 255, 255, 0.95);
    border: 2px dashed rgba(66, 133, 244, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    color: #1e293b;
}

.upload-dropzone:hover, .upload-dropzone.drag-active {
    background: #fff;
    border-color: #4285f4;
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.upload-dropzone i {
    width: 38px;
    height: 38px;
    color: #4285f4;
    margin: 0 auto 0.5rem;
}

.upload-dropzone .main-text {
    font-size: 0.95rem;
    font-weight: 600;
}

.upload-dropzone .sub-text {
    font-size: 0.8rem;
    color: #64748b;
}

.hidden-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.info-badge {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: white;
    font-size: 0.8rem;
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
    width: 100%;
}

.btn-cancel, .btn-apply {
    flex: 1;
    border: none;
    padding: 0.75rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-apply {
    background: #10b981;
    color: white;
}

.btn-apply:hover {
    background: #059669;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

/* Profile Selection Cards */
.profile-selectors {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-card {
    cursor: pointer;
}

.profile-card input {
    display: none;
}

.card-ui {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem;
    border: 2px solid var(--border);
    border-radius: 16px;
    transition: all 0.2s;
}

.icon-wrap {
    width: 48px;
    height: 48px;
    background: var(--bg-main);
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: var(--primary);
}

.text-wrap {
    display: flex;
    flex-direction: column;
}

.text-wrap .title {
    font-weight: 700;
    font-size: 1.1rem;
}

.text-wrap .desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.profile-card input:checked + .card-ui {
    border-color: var(--primary);
    background: rgba(30, 58, 138, 0.02);
    box-shadow: 0 4px 20px -5px rgba(30, 58, 138, 0.1);
}

.profile-card input:checked + .card-ui .icon-wrap {
    background: var(--primary);
    color: white;
}

.spacing-top {
    margin-top: 2rem;
}

/* Form Footer */
.form-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border);
}

.btn-back, .btn-next, .btn-finish {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-back {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}

.btn-back:hover {
    background: var(--bg-main);
}

.btn-next {
    background: var(--primary);
    color: white;
    border: none;
}

.btn-next:hover {
    background: #1e40af;
    transform: translateX(3px);
}

.btn-finish {
    background: #10b981;
    color: white;
    border: none;
}

.btn-finish:hover {
    background: #059669;
    transform: scale(1.02);
}

/* Responsive */
@media (max-width: 900px) {
    .sidebar {
        display: none;
    }
}

@media (max-width: 600px) {
    .main-content {
        padding: 1.5rem;
    }
    .form-wrapper {
        padding: 1.5rem;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .form-group.full {
        grid-column: span 1;
    }
}
