/* ============================================
   KESSID PREMIUM BRANDING - MASTER STYLESHEET
   ============================================ */

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

/* ----- FULL-SCREEN BACKGROUND ----- */
body {
    min-height: 100vh;
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.5)), 
                url('../images/main_picture.jpg') no-repeat center center fixed;
    background-size: cover;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ----- PREMIUM CONTAINER ----- */
.premium-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* ----- LOGIN CARD (GLASSMORPHISM) ----- */
.login-glass {
    max-width: 450px;
    margin: 0 auto 40px auto;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 30px 32px;
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-glass:hover {
    transform: translateY(-3px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
}

/* ----- LOGO AREA ----- */
.logo-area {
    text-align: center;
    margin-bottom: 20px;
}

.logo-area img {
    max-width: 70%;
    height: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* ----- STYLE NATIVE ROUNDCUBE FORM FIELDS ----- */
#login-form {
    width: 100%;
}

#login-form table {
    width: 100%;
    border: none;
}

#login-form tbody,
#login-form tr {
    display: block;
    width: 100%;
}

#login-form td {
    display: block;
    padding: 0;
    margin-bottom: 16px;
    width: 100%;
}

#login-form td.title {
    margin-bottom: 6px;
}

#login-form td.title label {
    display: block;
    color: #1a472a;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.3px;
}

#login-form td.input {
    margin-bottom: 0;
}

#login-form input[type="text"],
#login-form input[type="password"] {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 10px 14px;
    border: 1.5px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    box-sizing: border-box !important;
}

#login-form input:focus {
    outline: none;
    border-color: #d4af37;
    background: white;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

/* Style the login button */
#login-form .formbuttons {
    text-align: center;
    margin-top: 8px;
}

#login-form .button {
    width: 100%;
    background: linear-gradient(135deg, #1a472a 0%, #0d2b1a 100%);
    color: white;
    border: none;
    padding: 11px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

#login-form .button:hover {
    background: linear-gradient(135deg, #0d2b1a 0%, #1a472a 100%);
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(26, 71, 42, 0.3);
}

/* Hide the native checkbox wrapper, we'll add our own */
#login-form .formbuttons br {
    display: none;
}

/* ----- ERROR MESSAGE ----- */
.error-message {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 13px;
    display: none;
    align-items: center;
    gap: 8px;
    animation: slideDown 0.3s ease;
}

.error-message.show {
    display: flex;
}

.error-message::before {
    content: "⚠️";
    font-size: 16px;
}

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

/* ----- REMEMBER ME CHECKBOX (Custom) ----- */
.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
}

.remember-me input {
    width: auto;
    cursor: pointer;
}

.remember-me label {
    margin: 0;
    cursor: pointer;
    font-weight: normal;
    letter-spacing: normal;
    color: #444;
    font-size: 12px;
}

/* Hide native remember checkbox if present */
#login-form input[name="_remember"] {
    display: none;
}

/* ----- SCHOOL CARDS SECTION ----- */
.schools-section {
    margin-top: 30px;
}

.schools-title {
    text-align: center;
    color: white;
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 25px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

.schools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.school-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.school-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

/* ----- SCHOOL CARD LOGOS WITH WHITE CIRCLE BACKGROUND ----- */
.school-card .logo-circle {
    width: 100px;
    height: 100px;
    margin: 0 auto 12px auto;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.school-card:hover .logo-circle {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.school-card .logo-circle img {
    width: 65%;
    height: auto;
    object-fit: contain;
    margin: 0;
    display: block;
}

.school-card h4 {
    color: #1a472a;
    font-size: 17px;
    margin: 8px 0;
    font-weight: 700;
}

.school-card p {
    color: #555;
    font-size: 12px;
    line-height: 1.4;
}

/* ----- FOOTER ----- */
.footer {
    text-align: center;
    margin-top: 35px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
}

.footer a {
    color: #d4af37;
    text-decoration: none;
    font-weight: 600;
}

.footer a:hover {
    text-decoration: underline;
}

/* ----- MODAL STYLES ----- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    max-width: 500px;
    width: 90%;
    padding: 0;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

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

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

.modal-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, #1a472a 0%, #0d2b1a 100%);
    color: white;
    border-radius: 24px 24px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
    color: #333;
    line-height: 1.6;
    font-size: 14px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-body h4 {
    color: #1a472a;
    margin: 15px 0 8px 0;
    font-size: 16px;
}

.modal-body h4:first-child {
    margin-top: 0;
}

.modal-body p {
    margin: 10px 0;
}

.modal-body ul {
    margin: 10px 0;
    padding-left: 20px;
}

.modal-body li {
    margin: 8px 0;
}

.support-email {
    background: #f0f4f0;
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    margin: 15px 0;
    border: 1px solid #d4af37;
}

.support-email code {
    font-size: 16px;
    color: #1a472a;
    font-weight: 600;
    background: none;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e0e0e0;
    text-align: right;
}

.modal-btn {
    background: #1a472a;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.modal-btn:hover {
    background: #0d2b1a;
    transform: scale(1.02);
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #1a472a;
    border-radius: 3px;
}

/* ----- FORGOT PASSWORD LINK (add to bottom) ----- */
.forgot-password {
    text-align: right;
    margin-top: 10px;
}

.forgot-password a {
    color: #1a472a;
    font-size: 12px;
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.forgot-password a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ----- RESPONSIVE DESIGN ----- */
@media (max-width: 768px) {
    .login-glass {
        max-width: 95%;
        padding: 22px 24px;
        margin-bottom: 30px;
    }
    
    .schools-title {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .schools-grid {
        gap: 15px;
    }
    
    .school-card {
        padding: 15px;
    }
    
    .school-card .logo-circle {
        width: 80px;
        height: 80px;
    }
    
    .school-card img {
        width: 65px;
        height: 65px;
    }
    
    body {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .login-glass {
        padding: 20px;
    }
    
    #login-form input[type="text"],
    #login-form input[type="password"] {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .schools-title {
        font-size: 18px;
    }
}
