/* CSS Mejorado y Responsivo para Marcos Prestamista */

/* Reset y Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: url('../images/fondo.png') no-repeat center center fixed;
    background-size: cover;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

/* Control de caché para imágenes */
img[src$=".png"],
img[src$=".jpg"],
img[src$=".jpeg"],
img[src$=".gif"],
img[src$=".ico"] {
    add_header Cache-Control "no-cache, no-store, must-revalidate";
}

/* Layout Principal */
.container {
    width: 95%;
    max-width: 700px;
    margin: 20px auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
}

header img {
    max-width: 140px;
    height: auto;
    margin-bottom: 15px;
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 20px;
}

/* Typography */
h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #213753;
    margin-bottom: 15px;
    text-align: center;
    line-height: 1.3;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #213753;
    margin-bottom: 20px;
}

p {
    font-size: 1rem;
    color: #555;
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.7;
}

/* Info Boxes */
.info-box {
    background: linear-gradient(135deg, #e3f2fd, #f8fafe);
    border-left: 4px solid #2979ff;
    padding: 20px;
    margin: 20px 0;
    border-radius: 12px;
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
}

/* Form Elements */
.field-group, .form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: #213753;
    margin-bottom: 8px;
}

.required::after {
    content: " *";
    color: #e53935;
    font-weight: bold;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
select {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    background: #fafbfc;
    transition: all 0.3s ease;
    font-family: inherit;
}

input:focus, select:focus {
    outline: none;
    border-color: #2979ff;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(41, 121, 255, 0.1);
    transform: translateY(-1px);
}

/* Buttons */
.btn-submit,
button[type="submit"],
.btn {
    background: linear-gradient(135deg, #2979ff, #1976d2);
    color: white;
    padding: 16px 24px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(41, 121, 255, 0.3);
    font-family: inherit;
}

.btn-submit:hover,
button[type="submit"]:hover,
.btn:hover {
    background: linear-gradient(135deg, #1976d2, #0d47a1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(41, 121, 255, 0.4);
}

.btn-submit:active,
button[type="submit"]:active,
.btn:active {
    transform: translateY(0);
}

/* Slider Components */
.slider-container {
    padding: 20px 0;
}

.slider-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.9rem;
    font-weight: 500;
}

.slider-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2979ff;
    background: rgba(41, 121, 255, 0.1);
    padding: 5px 12px;
    border-radius: 8px;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #e0e0e0, #e0e0e0);
    border-radius: 6px;
    outline: none;
    margin: 10px 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2979ff, #1976d2);
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(41, 121, 255, 0.4);
    transition: all 0.2s ease;
}

input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2979ff, #1976d2);
    cursor: pointer;
    border: none;
    box-shadow: 0 3px 8px rgba(41, 121, 255, 0.4);
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(41, 121, 255, 0.6);
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(41, 121, 255, 0.6);
}

/* Card Layout para Bank Auth */
.card-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.card-col {
    min-width: 0; /* Para evitar overflow */
}

/* Logos y Security */
.card-logos, .security-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.card-logos img,
.card-logos div,
.security-icons img,
.security-icons div {
    height: 35px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.card-logos img:hover,
.security-icons img:hover {
    opacity: 1;
}

.security-note {
    font-size: 0.85rem;
    color: #666;
    text-align: center;
    margin-top: 15px;
    font-style: italic;
}

/* Loading States */
.loading-container, .wait-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 300px;
    padding: 40px 20px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2979ff;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin-bottom: 25px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress-bar-container {
    width: 100%;
    max-width: 400px;
    background-color: #e0e0e0;
    border-radius: 10px;
    margin: 25px 0;
    height: 25px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #2979ff, #1976d2);
    transition: width 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Error Messages */
.error-messages, .general-error {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    color: #c62828;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 12px;
    border-left: 4px solid #e53935;
    font-size: 0.95rem;
}

.error-messages ul {
    margin: 10px 0 0 20px;
}

.error-messages li {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Footer */
.footer {
    text-align: center;
    font-size: 0.85rem;
    color: #666;
    margin-top: 40px;
    padding: 30px 20px;
}

/* Responsive Design */

/* Tablets (768px y menores) */
@media (max-width: 768px) {
    .container {
        width: 98%;
        padding: 15px;
        margin: 10px auto;
    }

    .card {
        padding: 25px 20px;
        border-radius: 12px;
    }

    h1 {
        font-size: 1.6rem;
    }

    p {
        font-size: 0.95rem;
    }

    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="number"],
    select {
        padding: 12px 14px;
        font-size: 1rem;
    }

    .btn-submit,
    button[type="submit"],
    .btn {
        padding: 14px 20px;
        font-size: 1rem;
    }

    .card-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .slider-value {
        font-size: 1.2rem;
    }

    header img {
        max-width: 120px;
    }
}

/* Móviles (480px y menores) */
@media (max-width: 480px) {
    .container {
        width: 100%;
        padding: 10px;
        margin: 5px auto;
    }

    .card {
        padding: 20px 15px;
        margin-bottom: 15px;
    }

    h1 {
        font-size: 1.4rem;
        margin-bottom: 12px;
    }

    p {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }

    .field-group, .form-group {
        margin-bottom: 20px;
    }

    label {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }

    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="number"],
    select {
        padding: 12px;
        font-size: 16px; /* Para evitar zoom en iOS */
        border-radius: 10px;
    }

    .btn-submit,
    button[type="submit"],
    .btn {
        padding: 14px 18px;
        font-size: 1rem;
        border-radius: 10px;
    }

    .info-box {
        padding: 15px;
        font-size: 0.9rem;
        margin: 15px 0;
    }

    .slider-info {
        font-size: 0.85rem;
    }

    .slider-value {
        font-size: 1.1rem;
        padding: 4px 10px;
    }

    .card-logos, .security-icons {
        gap: 10px;
    }

    .card-logos img,
    .card-logos div,
    .security-icons img,
    .security-icons div {
        height: 28px;
    }

    .loading-container, .wait-container {
        min-height: 250px;
        padding: 30px 15px;
    }

    .spinner {
        width: 50px;
        height: 50px;
        margin-bottom: 20px;
    }

    .progress-bar-container {
        height: 22px;
        border-radius: 8px;
    }

    .security-note {
        font-size: 0.8rem;
    }

    header img {
        max-width: 100px;
    }

    .footer {
        font-size: 0.8rem;
        padding: 20px 15px;
    }
}

/* Móviles muy pequeños (360px y menores) */
@media (max-width: 360px) {
    .card {
        padding: 15px 12px;
    }

    h1 {
        font-size: 1.3rem;
    }

    .btn-submit,
    button[type="submit"],
    .btn {
        padding: 12px 15px;
        font-size: 0.95rem;
    }

    .field-group, .form-group {
        margin-bottom: 18px;
    }
}