@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-dark: #031E23;
    --primary-light: #0a4a5a;
    --accent: #22d3ee;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.5);
    --text-main: #0f172a;
    --text-muted: #64748b;
}

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

body {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0fdfa;
    /* Animated Mesh Gradient Background */
    background: radial-gradient(circle at 15% 50%, rgba(10, 74, 90, 0.15), transparent 30%),
        radial-gradient(circle at 85% 30%, rgba(34, 211, 238, 0.15), transparent 30%);
    background-size: 100% 100%;
    position: relative;
    overflow: hidden;
}

/* Moving blobs using pseudo elements on body */
body::before,
body::after {
    content: '';
    position: absolute;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    z-index: -1;
    filter: blur(120px);
}

body::before {
    background: rgba(10, 74, 90, 0.2);
    top: -15vw;
    left: -15vw;
}

body::after {
    background: rgba(14, 165, 233, 0.15);
    bottom: -15vw;
    right: -15vw;
}

/* MAIN CONTAINER (The Glass Card) */
.portal-wrapper {
    width: 100%;
    max-width: 900px;
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 36px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 40px 80px rgba(3, 30, 35, 0.1),
        inset 0 2px 0 rgba(255, 255, 255, 1);
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: 30px;
    position: relative;
    overflow: hidden;
}

/* LEFT SIDE (Branding) */
.portal-left {
    background: linear-gradient(145deg, var(--primary-light), var(--primary-dark));
    color: white;
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
}

/* Hexagon / Geometric flair on left */
.portal-left::after,
.portal-left::before {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.08), transparent);
}

.portal-left::before {
    width: 500px;
    height: 500px;
    top: -150px;
    left: -200px;
}

.portal-left::after {
    width: 600px;
    height: 600px;
    bottom: -200px;
    right: -250px;
}

/* Organizational Header */
.portal-org-header {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 10;
    padding: 0 20px;
}

.portal-org-header .org-name {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 1);
    text-transform: uppercase;
    line-height: 1.2;
}

.portal-org-header .org-region {
    margin: 5px 0 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

/* Responsive adjustments for branding */
@media(max-width: 900px) {
    .portal-org-header {
        position: relative;
        top: 0;
        margin-bottom: 40px;
        padding: 0;
    }

    .portal-left {
        padding-top: 60px !important;
        padding-bottom: 60px !important;
    }
}

.portal-left h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.15;
    z-index: 10;
    letter-spacing: -1px;
    background: linear-gradient(to right, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.portal-left p {
    opacity: 0.85;
    line-height: 1.6;
    margin-bottom: 35px;
    font-size: 15px;
    z-index: 10;
    font-weight: 300;
}

.admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.5px;
    width: fit-content;
    transition: all 0.15s ease-out;
    z-index: 10;
}

.admin-btn:hover {
    background: white;
    color: var(--primary-dark);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    border-color: white;
}

/* RIGHT SIDE (Form) */
.portal-right {
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: transparent;
    position: relative;
    z-index: 10;
}

.login-title {
    margin-bottom: 35px;
}

.login-title h2 {
    color: var(--text-main);
    font-size: 30px;
    font-weight: 800;
    margin: 0 0 10px 0;
    letter-spacing: -1px;
}

.login-title p {
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 400;
    margin: 0;
}

/* ALERTS */
.alert {
    padding: 1rem 1.2rem;
    border-radius: 12px;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
    font-weight: 500;
}

.alert-error {
    background: #fef2f2;
    color: #ef4444;
    border-color: #fecaca;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* INPUT */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    font-weight: 600;
    color: var(--primary-dark);
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
}

.form-group input {
    width: 100%;
    padding: 14px 18px;
    border-radius: 18px;
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    font-size: 16px;
    color: var(--text-main);
    font-family: inherit;
    font-weight: 500;
    transition: all 0.15s ease-out;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.02);
}

.form-group input:hover {
    background: rgba(255, 255, 255, 0.9);
}

.form-group input:focus {
    border-color: var(--primary-light);
    background: #ffffff;
    box-shadow: 0 0 0 5px rgba(10, 74, 90, 0.1);
    outline: none;
    transform: translateY(-2px);
}

.form-group input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.error {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 0.6rem;
    font-weight: 500;
}

/* LOGIN BUTTON */
.login-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 100px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    color: white;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.5px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease-out;
    box-shadow: 0 10px 25px rgba(3, 30, 35, 0.3);
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.login-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-20deg);
    transition: all 0.3s ease-out;
}

.login-btn:hover::after {
    left: 200%;
}

.login-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(3, 30, 35, 0.4);
}

.login-btn:active {
    transform: translateY(0);
    box-shadow: 0 8px 15px rgba(3, 30, 35, 0.2);
}

/* ADMIN LINK */
.admin-link {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    position: relative;
    z-index: 50;
}

.admin-link a {
    min-width: 130px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    border-radius: 100px;
    background: rgba(10, 74, 90, 0.05);
    border: 1.5px solid rgba(10, 74, 90, 0.15);
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    transition: all 0.15s ease-out;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.admin-link a:hover {
    background: white;
    color: var(--primary-light);
    border-color: rgba(10, 74, 90, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(10, 74, 90, 0.12);
}

.admin-link a:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(10, 74, 90, 0.08);
}

/* TABLET & MOBILE RESPONSIVE */
@media(max-width: 900px) {
    .portal-wrapper {
        grid-template-columns: 1fr;
        max-width: 450px;
        margin: 30px 20px;
        border-radius: 30px;
    }

    .portal-left {
        padding: 40px 30px;
        text-align: center;
    }

    .portal-left h1 {
        font-size: 30px;
    }

    .portal-right {
        padding: 40px 30px;
    }
}

/* SMALL MOBILE PHONES */
@media(max-width: 500px) {
    body {
        align-items: flex-start;
        padding-top: 10px;
    }

    .portal-wrapper {
        margin: 10px;
        border-radius: 24px;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    }

    .portal-left {
        padding: 30px 20px;
    }

    .portal-left h1 {
        font-size: 24px;
        margin-bottom: 12px;
    }

    .portal-org-header {
        margin-bottom: 25px;
    }

    .portal-org-header .org-name {
        font-size: 16px;
    }

    .portal-org-header .org-region {
        font-size: 12px;
    }

    .portal-left p {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .portal-right {
        padding: 30px 20px;
    }

    .login-title h2 {
        font-size: 24px;
    }

    .form-group input {
        padding: 12px 16px;
        border-radius: 12px;
        font-size: 14px;
    }

    .login-btn {
        padding: 14px;
        font-size: 15px;
    }

    .admin-link a {
        min-width: unset;
        width: 100%;
        padding: 10px 15px;
        font-size: 13px;
    }

    /* SweetAlert2 Mobile Responsive */
    .swal2-container {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        z-index: 999999 !important;
    }

    .swal2-popup {
        font-size: 0.85rem !important;
        padding: 1.25rem !important;
        width: 90% !important;
        margin: auto !important;
    }

    .swal2-title {
        font-size: 1.25rem !important;
    }

    .swal2-content,
    .swal2-html-container {
        font-size: 0.95rem !important;
    }

    .swal2-actions {
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
    }

    .swal2-actions button {
        width: 100%;
        margin: 0 !important;
    }
}