:root {
    --primary: #0f172a;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --bg-page: #f1f5f9;
    --text-main: #1e293b;
    --text-muted: #64748b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: linear-gradient(rgba(15, 23, 42, 0.45), rgba(15, 23, 42, 0.45)), url('../Images/Wallpaper/login_background.png');
    background-size: cover;
    background-position: center;
    overflow: hidden;
    position: relative;
}

/* The Pill Container */
.pill-container {
    display: flex;
    width: 100%;
    max-width: 900px;
    height: 600px;
    background: #ffffff;
    border-radius: 40px; /* High rounding for pill look */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    margin: 20px;
    animation: slideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Left Side: Visual/Background */
.pill-visual {
    flex: 1;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: white;
    position: relative;
    overflow: hidden;
}

.pill-visual::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, transparent 70%);
    animation: pulse 10s infinite;
}

@keyframes pulse {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(10%, 10%); }
}

.visual-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.pill-visual img {
    max-width: 180px;
    height: auto;
    margin-bottom: 30px;
    filter: drop-shadow(0 0 15px rgba(255,255,255,0.1));
    animation: float 4s ease-in-out infinite;
}

.text-logo {
    font-size: 56px;
    font-weight: 800;
    color: white;
    letter-spacing: 4px;
    margin-bottom: 20px;
    text-shadow: 0 10px 20px rgba(0,0,0,0.4);
    animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.pill-visual h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 15px;
    letter-spacing: -0.5px;
}

.pill-visual p {
    font-size: 16px;
    opacity: 0.7;
    line-height: 1.6;
}

/* Right Side: Form */
.pill-form {
    flex: 1.2;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #ffffff;
}

.form-header {
    margin-bottom: 40px;
}

.form-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.form-header p {
    color: var(--text-muted);
    font-size: 15px;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: all 0.3s;
}

.form-control {
    width: 100%;
    height: 52px;
    padding-left: 48px;
    padding-right: 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    font-size: 15px;
    color: var(--primary);
    transition: all 0.3s;
    outline: none;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.form-control:focus ~ i {
    color: var(--accent);
}

.toggle-pass {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
    cursor: pointer;
    padding: 5px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-pass:hover {
    color: var(--accent);
}

.options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    font-size: 14px;
}

.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-muted);
}

.remember input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.forgot {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.btn-submit {
    width: 100%;
    height: 56px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn-submit:hover {
    background: #1e293b;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.2);
}

/* Error Summary */
.err-summary {
    background: #fff1f2;
    border-left: 4px solid #ef4444;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 25px;
    color: #b91c1c;
    font-size: 14px;
}

.err-summary ul {
    list-style: none;
}

/* Loader Overlay */
.loader {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

.spinner {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 20%, #2563eb 100%);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 100%);
    mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 100%);
    animation: spin 0.8s linear infinite;
    filter: drop-shadow(0 0 12px rgba(37, 99, 235, 0.5));
    margin-bottom: 20px;
}

.loader p {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    animation: pulseText 1.5s ease-in-out infinite;
}

@keyframes pulseText {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 768px) {
    .pill-container {
        flex-direction: column;
        height: auto;
        max-width: 450px;
    }
    .pill-visual {
        padding: 40px 20px;
        min-height: 200px;
    }
    .pill-form {
        padding: 40px 30px;
    }
}
