/**
 * Bitennial Admin - Login Styles
 * Estilos para la página de login del admin de Django
 */

body {
    background: linear-gradient(135deg, #1a1f36 0%, #0d1025 100%);
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

html {
    overflow-y: auto;
}

.login-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    padding: 32px 36px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    position: relative;
    z-index: 1;
    margin: auto;
    box-sizing: border-box;
}

.crypto-icon {
    font-size: 44px;
    color: #3b82f6;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 6px rgba(59, 130, 246, 0.3));
}

.login-header {
    margin-bottom: 24px;
}

.login-header h1 {
    color: #1f2937;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 6px 0;
    letter-spacing: -0.5px;
}

.login-header p {
    color: #6b7280;
    font-size: 14px;
    margin: 0;
}

.form-group {
    margin-bottom: 18px;
    text-align: left;
}

.form-group label {
    display: block;
    color: #374151;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

/* Input base styles */
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"] {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s ease;
    box-sizing: border-box;
    background: #f9fafb;
    color: #1f2937;
}

.form-group input[type="text"]:hover,
.form-group input[type="password"]:hover,
.form-group input[type="email"]:hover {
    border-color: #d1d5db;
    background: #ffffff;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="email"]:focus {
    outline: none;
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

/* ================================================
   PASSWORD INPUT WITH TOGGLE
   ================================================ */
.password-input-wrapper {
    position: relative;
    width: 100%;
    display: block;
}

.password-input-wrapper input[type="password"],
.password-input-wrapper input[type="text"] {
    width: 100%;
    padding-right: 50px !important; /* Espacio para el ojo */
}

.password-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    outline: none;
}

.password-toggle:hover {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.password-toggle:focus {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.password-toggle:active {
    transform: translateY(-50%) scale(0.92);
}

.password-toggle i {
    font-size: 18px;
    pointer-events: none;
    transition: transform 0.2s ease;
}

/* ================================================
   LOGIN BUTTON
   ================================================ */
.btn-login {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
    margin-top: 6px;
}

.btn-login:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
    transform: translateY(-1px);
}

.btn-login:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-login .btn-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.2s ease;
}

.btn-login.loading .btn-text {
    opacity: 0;
}

.btn-login .spinner {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.btn-login.loading .spinner {
    display: inline-block;
}

.btn-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ================================================
   ERROR LIST
   ================================================ */
.errorlist {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #991b1b;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    list-style: none;
    border: 1px solid #fecaca;
    text-align: left;
}

.errorlist li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.errorlist li::before {
    content: "⚠";
    font-size: 14px;
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 480px) {
    body {
        padding: 20px 16px;
    }

    .login-container {
        padding: 28px 20px;
        border-radius: 12px;
    }

    .login-header h1 {
        font-size: 22px;
    }

    .crypto-icon {
        font-size: 40px;
        margin-bottom: 14px;
    }

    .form-group {
        margin-bottom: 16px;
    }
}
