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

/* Visual Style Variables */
:root {
    --primary-color: #00629b;
    --background-color: #f3f7fa;
    --card-background: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --input-bg: #ffffff;
    --shadow-color: rgba(15, 23, 42, 0.06);
    --device-box-bg: #f8fafc;
    --preview-bg: #ffffff;
}

body.dark-mode {
    --primary-color: #0284c7;
    --background-color: #090f17;
    --card-background: #0f172a;
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --border-color: #1e293b;
    --input-bg: #1e293b;
    --shadow-color: rgba(0, 0, 0, 0.4);
    --device-box-bg: #1e293b;
    --preview-bg: #1e293b;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    background-color: var(--background-color) !important;
    background-image: radial-gradient(#cbd5e1 1.5px, transparent 1.5px);
    background-size: 24px 24px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 20px;
    position: relative;
    transition: background 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

body.dark-mode {
    background-image: radial-gradient(#1e293b 1.5px, transparent 1.5px) !important;
}

.login-container {
    position: relative;
    width: 100%;
    z-index: 10;
}

.login-card {
    background: var(--card-background) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 24px !important;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px var(--shadow-color), 0 0 0 1px var(--border-color) !important;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Left Side: Elegant Branding Panel */
.brand-panel {
    background: #0f1e2e !important; /* Deep dark Navy */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 50px 40px;
    position: relative;
    overflow: hidden;
    min-height: 580px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    color: #ffffff;
    text-align: center;
}

body.dark-mode .brand-panel {
    background: #090f17 !important; /* Darker navy in dark mode */
}

.brand-preview-box {
    background: var(--preview-bg);
    border-radius: 16px;
    padding: 8px;
    width: 100%;
    max-width: 260px;
    aspect-ratio: 1.6 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    margin-bottom: 35px;
    z-index: 2;
    transition: transform 0.3s ease;
}

.brand-preview-box:hover {
    transform: translateY(-4px) scale(1.02);
}

.brand-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

.brand-title {
    font-size: 28px;
    font-weight: 800;
    color: #ffffff !important;
    letter-spacing: 1.5px;
    margin: 0;
    z-index: 2;
}

.brand-underline {
    width: 50px;
    height: 4px;
    background: #0284c7; /* Vibrant blue */
    border-radius: 2px;
    margin: 15px auto 25px auto;
    z-index: 2;
}

.brand-slogan {
    font-size: 14px;
    color: #94a3b8 !important; /* Slate 400 */
    font-weight: 500;
    line-height: 1.6;
    max-width: 280px;
    margin: 0;
    z-index: 2;
}

.brand-footer {
    margin-top: auto;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    z-index: 2;
}

/* Right Side: Clean form */
.form-panel {
    padding: 50px 50px !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--card-background) !important;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main) !important;
    margin-bottom: 12px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-subtitle {
    font-size: 15px;
    color: var(--text-muted) !important;
    line-height: 1.5;
    margin-bottom: 35px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-label-custom {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
    display: block;
}

.input-group-custom {
    position: relative;
    width: 100%;
}

.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8; /* Slate-400 */
    font-size: 16px;
    transition: all 0.3s ease;
    z-index: 5;
}

.form-control-custom {
    display: block !important;
    box-sizing: border-box !important;
    background: var(--input-bg) !important;
    border: 1.5px solid var(--border-color) !important;
    border-radius: 12px !important;
    padding: 14px 20px 14px 48px !important;
    color: var(--text-main) !important;
    font-size: 14px !important;
    width: 100%;
    height: 52px !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.form-control-custom:focus {
    background: var(--input-bg) !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 4px rgba(2, 98, 155, 0.12) !important;
    outline: none !important;
}

body.dark-mode .form-control-custom:focus {
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.2) !important;
}

.form-control-custom:focus ~ .input-icon {
    color: var(--primary-color);
}

.form-control-custom::placeholder {
    color: #94a3b8 !important;
}

body.dark-mode .form-control-custom::placeholder {
    color: #64748b !important;
}

/* Password show hide styling */
.password-toggle-btn {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    cursor: pointer;
    font-size: 16px;
    z-index: 5;
    transition: color 0.3s ease;
}

.password-toggle-btn:hover {
    color: var(--primary-color);
}

/* Premium Button styling */
.login-btn-custom {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    background: var(--primary-color) !important;
    border: none !important;
    border-radius: 12px !important;
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    height: 52px !important;
    box-shadow: 0 4px 12px rgba(2, 98, 155, 0.2) !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    cursor: pointer;
}

body.dark-mode .login-btn-custom {
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25) !important;
}

.login-btn-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(2, 98, 155, 0.3) !important;
    opacity: 0.95;
}

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

.forgot-link-custom {
    display: block;
    color: #0284c7 !important; /* Blue/cyan link */
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    transition: color 0.3s ease;
    text-align: center;
    margin-top: 15px;
}

.forgot-link-custom:hover {
    color: #0369a1 !important;
}

body.dark-mode .forgot-link-custom:hover {
    color: #ffffff !important;
}

/* Bottom Registered Device ID Container */
.device-id-container {
    background: var(--device-box-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 5px;
}

.device-id-container:hover {
    background: var(--border-color);
}

.device-id-icon-box {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 18px;
}

body.dark-mode .device-id-icon-box {
    color: #94a3b8;
}

.device-id-text-box {
    flex-grow: 1;
    min-width: 0; /* Prevents overflow */
}

.device-id-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.device-id-val {
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    word-break: break-all;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.device-id-copy-btn {
    color: #94a3b8;
    font-size: 16px;
    transition: color 0.2s ease;
}

.device-id-container:hover .device-id-copy-btn {
    color: var(--primary-color);
}

.form-divider {
    height: 1px;
    background: var(--border-color);
    margin: 25px 0;
    border: none;
}

/* Floating Settings Gear Button (Theme Toggle) */
.settings-floating-btn-wrapper {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 1000;
}

.settings-floating-btn {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.1);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    color: var(--text-muted);
    font-size: 20px;
    outline: none !important;
}

.settings-floating-btn:hover {
    transform: scale(1.1) rotate(45deg);
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.15);
    color: var(--primary-color);
}

/* Custom Alert Styles */
.alert-custom {
    background: rgba(220, 53, 69, 0.08) !important;
    border: 1px solid rgba(220, 53, 69, 0.15) !important;
    color: #ea868f !important;
    border-radius: 12px !important;
    font-size: 13px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.alert-custom-error {
    background: rgba(220, 53, 69, 0.08) !important;
    border: 1px solid rgba(220, 53, 69, 0.15) !important;
    color: #ea868f !important;
    border-radius: 12px !important;
    font-size: 13px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.alert-custom-success {
    background: rgba(40, 167, 69, 0.08) !important;
    border: 1px solid rgba(40, 167, 69, 0.15) !important;
    color: #75b798 !important;
    border-radius: 12px !important;
    font-size: 13px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

/* Custom OTP Text Input */
.otp-input-custom {
    display: block !important;
    box-sizing: border-box !important;
    background: var(--input-bg) !important;
    border: 1.5px solid var(--border-color) !important;
    border-radius: 12px !important;
    padding: 14px 20px !important;
    color: var(--text-main) !important;
    font-size: 24px !important;
    font-weight: 800 !important;
    letter-spacing: 8px !important;
    text-align: center !important;
    width: 100%;
    height: 58px !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.otp-input-custom:focus {
    background: var(--input-bg) !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 4px rgba(2, 98, 155, 0.12) !important;
    outline: none !important;
}

body.dark-mode .otp-input-custom:focus {
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.2) !important;
}

.otp-input-custom::placeholder {
    color: #94a3b8 !important;
    font-size: 16px !important;
    letter-spacing: normal !important;
    font-weight: normal !important;
}

body.dark-mode .otp-input-custom::placeholder {
    color: #64748b !important;
}

@media (max-width: 768px) {
    body {
        padding: 10px !important;
    }
    .brand-panel {
        min-height: auto;
        padding: 40px 24px;
    }
    .brand-preview-box {
        margin-bottom: 20px;
        max-width: 200px;
    }
    .brand-title {
        font-size: 22px;
    }
    .brand-underline {
        margin: 10px auto 15px auto;
    }
    .brand-slogan {
        font-size: 13px;
        max-width: 240px;
    }
    .brand-footer {
        display: none;
    }
    .form-panel {
        padding: 40px 24px !important;
    }
    .form-title {
        font-size: 24px;
    }
    .form-subtitle {
        font-size: 14px;
        margin-bottom: 25px;
    }
    .form-control-custom {
        height: 48px !important;
        font-size: 13px !important;
    }
    .login-btn-custom {
        height: 48px !important;
        font-size: 14px !important;
    }
    .settings-floating-btn-wrapper {
        bottom: 15px;
        right: 15px;
    }
}
