/* =============================================================
   GSP ERP — Modern Mobile-App & Desktop Login Portal Stylesheet
   Version: 6.0
   Responsive: Mobile App (< 768px) & Executive Desktop Portal (>= 768px)
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Base */
    --portal-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --portal-bg: #090e17;
    
    /* Role Themes: Default Admin */
    --role-accent: #10b981;
    --role-accent-rgb: 16, 185, 129;
    --role-gradient: linear-gradient(135deg, #059669 0%, #10b981 100%);
    --role-glow: rgba(16, 185, 129, 0.25);
    --role-bg-subtle: rgba(16, 185, 129, 0.08);
}

/* Role Specific Theme Classes */
body.theme-admin {
    --role-accent: #10b981;
    --role-accent-rgb: 16, 185, 129;
    --role-gradient: linear-gradient(135deg, #0f766e 0%, #10b981 100%);
    --role-glow: rgba(16, 185, 129, 0.3);
    --role-bg-subtle: rgba(16, 185, 129, 0.1);
}

body.theme-student {
    --role-accent: #6366f1;
    --role-accent-rgb: 99, 102, 241;
    --role-gradient: linear-gradient(135deg, #4338ca 0%, #6366f1 50%, #06b6d4 100%);
    --role-glow: rgba(99, 102, 241, 0.35);
    --role-bg-subtle: rgba(99, 102, 241, 0.1);
}

body.theme-teacher {
    --role-accent: #2563eb;
    --role-accent-rgb: 37, 99, 235;
    --role-gradient: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
    --role-glow: rgba(37, 99, 235, 0.35);
    --role-bg-subtle: rgba(37, 99, 235, 0.1);
}

body.theme-accountant {
    --role-accent: #059669;
    --role-accent-rgb: 5, 150, 105;
    --role-gradient: linear-gradient(135deg, #047857 0%, #10b981 100%);
    --role-glow: rgba(5, 150, 105, 0.35);
    --role-bg-subtle: rgba(5, 150, 105, 0.1);
}

body.theme-frontoffice {
    --role-accent: #f59e0b;
    --role-accent-rgb: 245, 158, 11;
    --role-gradient: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    --role-glow: rgba(245, 158, 11, 0.35);
    --role-bg-subtle: rgba(245, 158, 11, 0.1);
}

/* Background Atmosphere */
body.portal-body {
    font-family: var(--portal-font);
    background: #0f172a;
    background-image: 
        radial-gradient(at 0% 0%, rgba(var(--role-accent-rgb), 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(30, 41, 59, 0.8) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(15, 23, 42, 0.9) 0px, transparent 100%);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 16px;
    color: #0f172a;
    transition: background 0.4s ease;
    overflow-x: hidden;
}

/* Desktop Split Layout Card */
.portal-container {
    width: 100%;
    max-width: 1050px;
    background: #ffffff;
    border-radius: 28px;
    box-shadow: 
        0 25px 60px -15px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    display: flex;
    min-height: 650px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Left Hero Brand Panel (Desktop) */
.portal-hero {
    flex: 1.1;
    background: linear-gradient(145deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.portal-hero::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: var(--role-accent);
    opacity: 0.18;
    filter: blur(60px);
    transition: all 0.5s ease;
}

.portal-hero::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -60px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: #3b82f6;
    opacity: 0.12;
    filter: blur(50px);
}

.hero-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #e2e8f0;
    backdrop-filter: blur(10px);
    width: fit-content;
}

.hero-logo-box {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.hero-logo-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
}

.hero-feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    margin-bottom: 10px;
    backdrop-filter: blur(8px);
    transition: transform 0.2s ease, background 0.2s ease;
}

.hero-feature-item:hover {
    background: rgba(255, 255, 255, 0.09);
    transform: translateX(4px);
}

.hero-feature-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    background: var(--role-bg-subtle);
    color: var(--role-accent);
    border: 1px solid rgba(var(--role-accent-rgb), 0.25);
}

/* Right Form Studio Panel */
.portal-form-panel {
    flex: 1.25;
    padding: 44px 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #ffffff;
    position: relative;
}

/* Role Selector Segmented Tabs */
.role-tabs-wrapper {
    background: #f1f5f9;
    padding: 5px;
    border-radius: 16px;
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.role-tabs-wrapper::-webkit-scrollbar {
    display: none;
}

.role-tab-btn {
    flex: 1;
    min-width: fit-content;
    padding: 9px 12px;
    border: none;
    background: transparent;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.role-tab-btn i {
    font-size: 13px;
    transition: transform 0.2s ease;
}

.role-tab-btn:hover {
    color: #1e293b;
    background: rgba(255, 255, 255, 0.6);
}

.role-tab-btn.active {
    background: #ffffff;
    color: var(--role-accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.role-tab-btn.active i {
    transform: scale(1.15);
}

/* Role Identity Header */
.role-header-badge {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.role-icon-avatar {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--role-bg-subtle);
    border: 2px solid rgba(var(--role-accent-rgb), 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--role-accent);
    box-shadow: 0 8px 16px var(--role-glow);
    transition: all 0.3s ease;
}

.role-title-text {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.3px;
    margin: 0;
    line-height: 1.25;
}

.role-sub-text {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin: 2px 0 0 0;
}

/* Modern App Inputs */
.app-input-group {
    margin-bottom: 18px;
    position: relative;
}

.app-input-label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #475569;
    margin-bottom: 7px;
}

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

.app-input-icon {
    position: absolute;
    left: 16px;
    color: #94a3b8;
    font-size: 15px;
    pointer-events: none;
    transition: color 0.2s ease;
}

.app-input-field {
    width: 100%;
    height: 52px;
    padding: 12px 16px 12px 46px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    font-family: var(--portal-font);
    font-size: 14.5px;
    font-weight: 600;
    color: #0f172a;
    outline: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-input-field::placeholder {
    color: #94a3b8;
    font-weight: 500;
}

.app-input-field:focus {
    background: #ffffff;
    border-color: var(--role-accent);
    box-shadow: 0 0 0 4px var(--role-bg-subtle);
}

.app-input-field:focus + .app-input-icon,
.app-input-wrapper:focus-within .app-input-icon {
    color: var(--role-accent);
}

/* Password Toggle Eye Button */
.password-toggle-btn {
    position: absolute;
    right: 14px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.password-toggle-btn:hover {
    color: #1e293b;
    background: #e2e8f0;
}

/* Login Action Button */
.portal-submit-btn {
    width: 100%;
    height: 52px;
    background: var(--role-gradient);
    border: none;
    border-radius: 14px;
    font-family: var(--portal-font);
    font-size: 14.5px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 10px 24px var(--role-glow);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: 6px;
}

.portal-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px var(--role-glow);
    filter: brightness(1.04);
}

.portal-submit-btn:active {
    transform: translateY(0);
}

.portal-submit-btn:disabled {
    opacity: 0.75;
    cursor: not-allowed;
    transform: none;
}

/* Alert Notification Box */
.portal-alert {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 18px;
    display: none;
    animation: fadeIn 0.3s ease;
}

.portal-alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.portal-alert-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* Secondary Navigation & Support */
.portal-footer-links {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 20px;
    margin-top: 10px;
    border-top: 1px solid #f1f5f9;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.portal-footer-links a {
    color: #475569;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s ease;
}

.portal-footer-links a:hover {
    color: var(--role-accent);
}

/* Top App Bar on Mobile */
.mobile-app-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 18px;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
}

/* =============================================================
   MOBILE APP VIEW (< 768px)
   ============================================================= */
@media (max-width: 768px) {
    body.portal-body {
        padding: 0;
        justify-content: flex-start;
        background: #0f172a;
    }

    .portal-container {
        border-radius: 0;
        box-shadow: none;
        flex-direction: column;
        min-height: 100vh;
        min-height: 100dvh;
        background: transparent;
    }

    /* Collapse hero into a mobile branding banner */
    .portal-hero {
        flex: none;
        padding: 24px 20px 20px 20px;
        background: linear-gradient(180deg, #090e17 0%, #0f172a 100%);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .portal-hero-content {
        display: flex;
        align-items: center;
        gap: 14px;
    }

    .portal-hero-features,
    .portal-hero-footer {
        display: none !important;
    }

    .hero-logo-box {
        width: 48px;
        height: 48px;
        border-radius: 14px;
        flex-shrink: 0;
    }

    .hero-title-main {
        font-size: 1.15rem !important;
        font-weight: 800;
        margin: 0;
    }

    .hero-subtitle-main {
        font-size: 10.5px !important;
        margin-top: 2px;
        opacity: 0.8;
    }

    /* Form Panel becomes App Card on mobile */
    .portal-form-panel {
        flex: 1;
        padding: 24px 18px 36px 18px;
        border-radius: 28px 28px 0 0;
        background: #ffffff;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.25);
        margin-top: -12px;
        z-index: 10;
    }

    /* Swipeable Role Tabs */
    .role-tabs-wrapper {
        margin: 0 -6px 20px -6px;
        padding: 4px;
        border-radius: 14px;
        justify-content: flex-start;
    }

    .role-tab-btn {
        padding: 8px 12px;
        font-size: 11.5px;
    }

    .role-icon-avatar {
        width: 46px;
        height: 46px;
        font-size: 19px;
    }

    .role-title-text {
        font-size: 1.2rem;
    }

    .app-input-field {
        height: 50px;
        font-size: 14px;
    }

    .portal-submit-btn {
        height: 50px;
        font-size: 14px;
    }

    .portal-footer-links {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

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