/* ==========================================================================
   EchoWave ISP Billing System - Modern Login UI Design System
   ========================================================================== */

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

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

body.login-body {
    min-height: 100vh;
    font-family: 'Plus Jakarta Sans', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #090d16 radial-gradient(circle at 50% 10%, rgba(229, 57, 53, 0.12) 0%, rgba(15, 23, 42, 0.8) 50%, #090d16 100%);
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body.master-login-body {
    background: #090d16 radial-gradient(circle at 50% 10%, rgba(99, 102, 241, 0.14) 0%, rgba(15, 23, 42, 0.8) 50%, #090d16 100%);
}

.login-wrapper {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

.login-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 36px 32px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.4), 0 0 1px 1px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(226, 232, 240, 0.8);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #E53935 0%, #ff6b6b 50%, #E53935 100%);
}

.master-login-card::before {
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 50%, #6366f1 100%);
}

/* Header & Brand Identity */
.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.login-logo-img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 18px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    background: #ffffff;
    padding: 4px;
    border: 1px solid #f1f5f9;
}

.login-logo-badge {
    width: 68px;
    height: 68px;
    background: linear-gradient(135deg, #E53935 0%, #C62828 100%);
    color: #ffffff;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    box-shadow: 0 10px 25px rgba(229, 57, 53, 0.35);
}

.master-logo-badge {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.35);
}

.login-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
    text-transform: capitalize;
}

.login-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    color: #475569;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.login-badge-pill i {
    color: #E53935;
    font-size: 0.85rem;
}

.master-badge-pill i {
    color: #6366f1;
}

/* Alert Notification */
.login-alert-danger {
    background: #fef2f2;
    border: 1.5px solid #fecaca;
    color: #991b1b;
    border-radius: 14px;
    padding: 12px 16px;
    font-size: 0.86rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-alert-danger i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Form Styles */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.form-label-custom {
    font-size: 0.84rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.input-icon-wrap {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.input-leading-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.1rem;
    pointer-events: none;
    transition: color 0.2s ease;
    z-index: 2;
}

.form-control-custom {
    width: 100%;
    height: 48px;
    padding: 0 42px 0 42px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    color: #0f172a;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    outline: none;
    transition: all 0.2s ease;
}

.form-control-custom::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.form-control-custom:focus {
    background: #ffffff;
    border-color: #E53935;
    box-shadow: 0 0 0 4px rgba(229, 57, 53, 0.12);
}

.master-control:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14);
}

.input-icon-wrap:focus-within .input-leading-icon {
    color: #E53935;
}

.master-icon-wrap:focus-within .input-leading-icon {
    color: #6366f1;
}

/* Password Toggle Button */
.btn-toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.2s ease;
    z-index: 2;
}

.btn-toggle-password:hover {
    color: #0f172a;
}

/* Action Button */
.btn-login-main {
    width: 100%;
    height: 50px;
    background: linear-gradient(135deg, #E53935 0%, #C62828 100%);
    color: #ffffff;
    border: none;
    border-radius: 14px;
    font-size: 0.96rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    margin-top: 6px;
    box-shadow: 0 8px 20px rgba(229, 57, 53, 0.3);
    transition: all 0.2s ease;
}

.btn-login-main:hover {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    transform: translateY(-1px);
    box-shadow: 0 12px 25px rgba(229, 57, 53, 0.38);
}

.btn-login-main:active {
    transform: translateY(0);
}

.btn-master-main {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.btn-master-main:hover {
    background: linear-gradient(135deg, #818cf8 0%, #4338ca 100%);
    box-shadow: 0 12px 25px rgba(99, 102, 241, 0.38);
}

.btn-login-main:disabled {
    opacity: 0.75;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.login-spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    display: inline-block;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Security Note */
.login-security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 600;
    margin-top: 14px;
    text-align: center;
}

.login-security-note i {
    color: #10b981;
    font-size: 0.85rem;
}

/* Footer Section */
.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #f1f5f9;
}

.login-footer-text {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 500;
}

.powered-by-link {
    color: #E53935;
    font-weight: 800;
    text-decoration: none;
    transition: text-decoration 0.15s;
}

.powered-by-link:hover {
    text-decoration: underline;
}

.master-powered-link {
    color: #6366f1;
}

/* Entrance Animation */
.fade-in {
    animation: loginFadeIn 0.35s ease-out;
}

@keyframes loginFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    body.login-body {
        padding: 14px;
    }

    .login-card {
        padding: 28px 20px;
        border-radius: 20px;
    }

    .login-title {
        font-size: 1.3rem;
    }

    .form-control-custom {
        height: 46px;
        font-size: 0.88rem;
    }

    .btn-login-main {
        height: 46px;
        font-size: 0.92rem;
    }
}
