/* ============================================
   LOGIN PAGE STYLES
   ============================================ */

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

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #1a365d 0%, #2563eb 50%, #0891b2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Animated background shapes */
body::before,
body::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    animation: float 20s ease-in-out infinite;
}

body::before {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.3) 0%, transparent 70%);
    top: -250px;
    right: -250px;
}

body::after {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(8, 145, 178, 0.3) 0%, transparent 70%);
    bottom: -200px;
    left: -200px;
    animation-direction: reverse;
    animation-duration: 15s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, 30px) scale(1.1); }
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    animation: fadeInUp 0.6s ease-out;
}

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

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.25),
                0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    padding: 32px 28px;
    animation: scaleIn 0.4s ease-out;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.login-logo {
    text-align: center;
    margin-bottom: 20px;
    animation: fadeInDown 0.6s ease-out 0.2s both;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-logo-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #2563eb 0%, #0891b2 100%);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.login-logo-icon svg {
    width: 32px;
    height: 32px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #1a365d;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.login-header p {
    font-size: 14px;
    color: #64748b;
}

/* Alert styles */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    border-left: 4px solid;
    font-size: 14px;
    animation: slideIn 0.3s ease-out;
}

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

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-color: #10b981;
    color: #065f46;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
    border-color: #ef4444;
    color: #991b1b;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
    border-color: #f59e0b;
    color: #92400e;
}

/* Form styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 15px;
    color: #334155;
    letter-spacing: 0.3px;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.form-control:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    background: #ffffff;
    transform: translateY(-1px);
}

select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    appearance: none;
}

/* Button styles */
.btn {
    width: 100%;
    padding: 20px;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-top: 12px;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #0891b2 100%);
    color: white;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 18px 40px rgba(37, 99, 235, 0.5);
}

.btn-primary:active {
    transform: translateY(-1px) scale(1.01);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    animation: fadeIn 0.6s ease-out 0.4s both;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.login-footer small {
    color: #94a3b8;
    font-size: 12px;
}

/* Input wrapper with icon */
.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.3s;
    font-size: 16px;
}

.input-wrapper .form-control {
    padding-left: 50px;
    padding-right: 50px;
}

.input-wrapper:focus-within .input-icon {
    color: #2563eb;
}

/* Password toggle button */
.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.password-toggle:hover {
    color: #2563eb;
}

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

/* Database badges */
.database-badges {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.db-badge {
    flex: 1;
    min-width: 90px;
    padding: 16px 12px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.db-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #2563eb 0%, #0891b2 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.db-badge:hover::before {
    opacity: 0.1;
}

.db-badge input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.db-badge.selected {
    border-color: #2563eb;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(8, 145, 178, 0.05) 100%);
}

.db-badge.selected::after {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 6px;
    color: #2563eb;
    font-size: 14px;
    font-weight: bold;
}

.db-badge-label {
    position: relative;
    z-index: 1;
    font-size: 15px;
    font-weight: 700;
    color: #334155;
    letter-spacing: 0.5px;
}

/* Responsive */
@media (max-width: 640px) {
    body {
        padding: 16px;
    }

    .login-container {
        max-width: 100%;
    }

    .login-card {
        padding: 24px 20px;
    }

    .database-badges {
        flex-direction: column;
        gap: 8px;
    }

    .db-badge {
        padding: 14px 16px;
        min-width: 100%;
    }

    .login-logo-icon {
        width: 56px;
        height: 56px;
    }

    .login-logo-icon svg {
        width: 30px;
        height: 30px;
    }

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

    .login-header p {
        font-size: 13px;
    }

    .form-control {
        padding: 12px 16px;
        font-size: 16px; /* Previne zoom no iOS */
    }

    .input-wrapper .form-control {
        padding-left: 45px;
    }

    .btn {
        padding: 16px;
        font-size: 16px;
    }

    .alert {
        font-size: 13px;
        padding: 10px 14px;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .login-card {
        padding: 20px 16px;
    }

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

    .form-group label {
        font-size: 14px;
    }
}

/* Prevent zoom on input focus (iOS) */
@supports (-webkit-touch-callout: none) {
    .form-control {
        font-size: 16px !important;
    }
}
