:root {
    --primary-color: #0c66ff;
    --primary-dark: color-mix(in srgb, var(--primary-color) 85%, black);
    --bg-color: #f0f2f5;
    --surface-color: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --error-bg: #fef2f2;
    --error-text: #ef4444;
    --error-border: #fca5a5;
    --radius-lg: 12px;
    --radius-md: 8px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
}

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

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    background-image: radial-gradient(at 0% 0%, rgba(12, 102, 255, 0.05) 0px, transparent 50%),
                      radial-gradient(at 100% 100%, rgba(12, 102, 255, 0.05) 0px, transparent 50%);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.login-card {
    background-color: var(--surface-color);
    padding: 2.5rem 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255,255,255,0.5);
    animation: fadeIn 0.4s ease-out;
}

.header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    max-width: 200px;
    max-height: 70px;
    margin-bottom: 1.25rem;
    object-fit: contain;
}

.title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-wrapper .input-icon-left {
    position: absolute;
    left: 1rem;
    color: #94a3b8;
    width: 20px;
    height: 20px;
    pointer-events: none;
    transition: color 0.3s ease;
}

input[type="email"],
input[type="password"],
input[type="text"] {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    color: var(--text-primary);
    background-color: #f8fafc;
    transition: all 0.3s ease;
}

/* Espacio extra a la derecha para el botón de mostrar contraseña */
#pass {
    padding-right: 3rem !important;
}

input::placeholder {
    color: #cbd5e1;
}

input:hover {
    border-color: #94a3b8;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--surface-color);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-color) 15%, transparent);
}

input:focus + .input-icon-left {
    color: var(--primary-color);
}

.btn-toggle-password {
    position: absolute;
    right: 0.5rem;
    background: transparent;
    border: none;
    padding: 0.5rem;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: var(--radius-sm);
}

.btn-toggle-password:hover {
    color: var(--text-primary);
    background-color: rgba(0, 0, 0, 0.05);
}

.btn-toggle-password svg {
    width: 20px;
    height: 20px;
}

.btn-login {
    width: 100%;
    padding: 0.875rem;
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    margin-top: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn-login:hover {
    background-color: var(--primary-dark);
}

.btn-login:active {
    transform: translateY(1px);
}

.turnstile-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
    min-height: 65px;
}

.error-msg {
    background-color: var(--error-bg);
    color: var(--error-text);
    border: 1px solid var(--error-border);
    padding: 0.875rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    line-height: 1.4;
}

.error-msg svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

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

/* Loader for login.php */
.full-screen-loader {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: var(--bg-color);
    text-align: center;
    animation: fadeIn 0.3s ease-out;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid color-mix(in srgb, var(--primary-color) 20%, transparent);
    border-bottom-color: var(--primary-color);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    margin-bottom: 1.5rem;
}

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

.loader-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.loader-subtext {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Modo Debug UI */
.debug-card {
    background: var(--surface-color);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border-top: 5px solid #10b981;
    max-width: 500px;
    width: 100%;
    animation: fadeIn 0.4s ease-out;
}

.debug-card h2 {
    color: #047857;
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
}

.debug-card code {
    background: #f1f5f9;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.9em;
    color: #0f172a;
}

.debug-card .info {
    margin: 1.5rem 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.debug-card ul {
    margin-top: 1rem;
    list-style: none;
    padding: 0;
}

.debug-card ul li {
    background: #f8fafc;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.debug-card .btn {
    display: inline-block;
    width: 100%;
    text-align: center;
    margin-top: 1rem;
    padding: 0.875rem;
    background: #10b981;
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: background 0.3s ease;
}

.debug-card .btn:hover {
    background: #059669;
}
