/* Estilos Minimalistas para Área de Cliente */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
    color: #1a1a1a;
    line-height: 1.6;
}

/* Login Container */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 3rem 2.5rem;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 450px;
}

.logo-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

.logo-container .logo {
    max-width: 200px;
    height: auto;
    max-height: 80px;
    object-fit: contain;
}

.login-box h1 {
    color: #1a1a1a;
    text-align: center;
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.login-box h2 {
    color: #666;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 400;
    margin-bottom: 2rem;
}

/* Tabs */
.login-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e9ecef;
}

.tab-btn {
    flex: 1;
    padding: 0.875rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    font-size: 0.9rem;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-weight: 500;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

.tab-content {
    display: none;
}

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

/* QR Scanner Section */
.qr-scanner-section {
    text-align: center;
}

.qr-scanner-section p {
    margin-bottom: 1rem;
    color: #666;
    font-size: 0.9rem;
}

.qr-alternative {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
    font-size: 0.875rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="date"] {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s;
    background: #fafafa;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.4rem;
    color: #666;
    font-size: 0.8rem;
}

.forgot-password {
    color: #667eea;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.forgot-password:hover {
    color: #5568d3;
    text-decoration: underline;
}

.form-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.form-footer a {
    color: #667eea;
    text-decoration: none;
    font-size: 0.875rem;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.875rem 1.5rem;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
    width: 100%;
    text-align: center;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    border: 1px solid;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

/* Cliente Wrapper */
.cliente-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.cliente-header {
    background: #ffffff;
    border-bottom: 1px solid #e9ecef;
    padding: 1.25rem 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.header-content {
    max-width: 1680px;
    width: 100%;
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 2.75rem);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-logo-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.cliente-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: -0.5px;
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: #666;
}

/* Main Content */
.cliente-main {
    max-width: 1680px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 clamp(1rem, 4vw, 2.75rem);
    flex: 1;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h2 {
    color: #1a1a1a;
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.welcome-section {
    background: white;
    padding: clamp(1.25rem, 3vw, 2rem) clamp(1.25rem, 3vw, 2.25rem);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    margin-bottom: 2rem;
}

@media (min-width: 900px) {
    .welcome-section {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        justify-content: space-between;
        column-gap: 2rem;
        row-gap: 0.35rem;
    }

    .welcome-section h2 {
        margin-bottom: 0;
        flex: 0 1 auto;
    }

    .welcome-section p {
        flex: 1 1 280px;
        margin-bottom: 0;
        text-align: right;
    }
}

.welcome-section h2 {
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.welcome-section p {
    color: #666;
    font-size: 0.95rem;
}

.cliente-section-heading {
    margin: 1.5rem 0 0.75rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: -0.25px;
}

/* Resultados Grid: pocas columnas para que las tarjetas no queden aplastadas */
.resultados-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: clamp(1rem, 2vw, 1.75rem);
}

@media (min-width: 900px) {
    .resultados-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr));
    }
}

@media (min-width: 1400px) {
    .resultados-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr));
    }
}

.resultado-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    overflow: hidden;
    transition: all 0.2s;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.resultado-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #5568d3 100%);
    color: white;
    padding: 1.25rem;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

.card-body {
    padding: 1.5rem;
    flex: 1 1 auto;
}

.card-body p {
    margin-bottom: 0.75rem;
    color: #666;
    font-size: 0.9rem;
}

.card-body strong {
    color: #333;
    font-weight: 600;
}

/* Vista previa de resultado (imagen / PDF) */
.resultado-preview {
    margin: -0.25rem 0 1rem;
    border-radius: 8px;
    overflow: hidden;
    background: #f1f3f5;
    border: 1px solid #e9ecef;
}

.resultado-preview--imagen .resultado-preview__link {
    display: block;
    line-height: 0;
    text-align: center;
    background: #fff;
}

.resultado-preview--imagen img {
    max-width: 100%;
    max-height: min(380px, 50vh);
    width: auto;
    height: auto;
    object-fit: contain;
    vertical-align: middle;
}

.resultado-preview--pdf iframe {
    display: block;
    width: 100%;
    height: min(420px, 55vh);
    border: none;
    background: #525659;
}

.resultado-preview__hint {
    margin: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    text-align: center;
    background: #fff;
    border-top: 1px solid #e9ecef;
}

.resultado-preview__hint a {
    color: #5568d3;
    font-weight: 500;
}

.card-footer {
    padding: 1rem 1.5rem;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    margin-top: auto;
}

.card-footer .btn {
    width: auto;
}

/* Empty State */
.empty-state {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    text-align: center;
    color: #666;
}

.empty-state p {
    margin-bottom: 0.5rem;
}

/* Form Container */
.form-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    max-width: 600px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.form-actions .btn {
    width: auto;
    flex: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .login-box {
        padding: 2rem 1.5rem;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .user-info {
        justify-content: center;
        width: 100%;
    }
    
    .resultados-grid {
        grid-template-columns: 1fr;
    }
    
    .form-container {
        padding: 1.5rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}
