@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
}

body {
    overflow-x: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    color: #2d3748;
    background: #edf0f5;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: inherit;
    font-weight: normal;
    margin: 0 0 10px;
    text-rendering: optimizelegibility;
    color: inherit;
}

a:hover, a:focus {
    color: #5a67d8;
    outline: none;
    text-decoration: none;
}

/* =============================================
   ANIMATED BACKGROUND
   ============================================= */
.loginpage {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    overflow: hidden;
    background: linear-gradient(145deg, #e4e8ef 0%, #f2f4f8 40%, #e8ecf2 70%, #dde2ea 100%);
}

/* Animated soft gradient overlay */
.loginpage::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 15% 20%, rgba(170, 185, 210, 0.45) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 80%, rgba(155, 170, 200, 0.38) 0%, transparent 55%);
    animation: bgPulse 14s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}

/* Subtle dot grid */
.loginpage::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(130, 150, 175, 0.15) 1px, transparent 0);
    background-size: 40px 40px;
    animation: dotGridMove 25s linear infinite;
    pointer-events: none;
    z-index: 0;
}

/* Floating blobs (injected via markup) */
.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.38;
    pointer-events: none;
    z-index: 0;
}

/* =============================================
   LAYOUT
   ============================================= */
/* Right decorative panel (background image side) */
.columns:not(.leftcol) {
    position: relative;
    flex: 1 1 50%;
    background: url("../images/login-bg-grey.jpg") no-repeat center center;
    background-size: cover;
}

.columns:not(.leftcol)::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(225, 232, 242, 0.5) 0%, rgba(205, 215, 232, 0.3) 100%);
}

/* Login form side */
.login_wrap {
    position: relative;
    z-index: 2;
    flex: 0 0 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.06);
}

/* =============================================
   LOGIN CARD
   ============================================= */
.vd_login-page {
    background: rgba(255, 255, 255, 0.93);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.95);
    box-shadow:
        0 8px 32px rgba(90, 110, 140, 0.13),
        0 2px 8px rgba(90, 110, 140, 0.07),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    width: 100%;
    max-width: 460px;
    padding: 52px 44px 44px;
    position: relative;
    overflow: hidden;
    animation: cardEntrance 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
    text-align: center;
}

/* Animated accent line at top of card */
.vd_login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #a0aec0 0%, #667eea 40%, #a0aec0 80%, #667eea 100%);
    background-size: 200% 100%;
    animation: shimmerLine 5s linear infinite;
}

/* Decorative inner glow */
.vd_login-page::after {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(195, 210, 230, 0.22) 0%, transparent 70%);
    pointer-events: none;
}

/* =============================================
   HEADING / LOGO
   ============================================= */
.heading {
    padding-bottom: 28px;
    animation: fadeSlideDown 0.55s ease-out 0.15s both;
}

.heading h3 {
    font-size: 25px;
    font-weight: 700;
    color: #2d3748;
    margin: 18px 0 10px;
    letter-spacing: -0.4px;
    line-height: 1.2;
}

.heading p {
    color: #718096;
    font-size: 14px;
    margin: 0;
}

.logo {
    display: flex;
    width: 100%;
    min-height: 72px;
    align-items: center;
    justify-content: center;
}

.loginimg {
    background-size: contain !important;
    background-position: center !important;
    width: 100%;
    max-width: 200px;
    height: 56px;
    display: block;
    margin: 0 auto;
}

/* =============================================
   PANEL (wrapper around form fields)
   ============================================= */
.panel {
    border: none;
    background: transparent;
    box-shadow: none;
}

.panel .panel-body {
    padding: 0;
    position: relative;
}

.login-icon {
    display: none !important;
}

/* =============================================
   FORM & INPUTS
   ============================================= */
.form-group {
    animation: fadeSlideDown 0.5s ease-out 0.25s both;
}

.form-group.loginfields {
    margin: 0;
}

.vd_input-wrapper {
    margin-bottom: 16px;
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.vd_input-wrapper input,
.vd_input-wrapper select {
    width: 100% !important;
    padding: 0 16px 0 44px !important;
    border: 1.5px solid #d1d9e6 !important;
    border-radius: 10px !important;
    height: 48px !important;
    font-size: 14px !important;
    font-family: inherit !important;
    font-weight: 500 !important;
    color: #2d3748 !important;
    background-color: rgba(247, 249, 252, 0.85) !important;
    transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease !important;
    outline: none !important;
    -webkit-appearance: none;
    box-sizing: border-box !important;
}

.menu-icon {
    position: absolute;
    left: 14px;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    color: #a0aec0;
    font-size: 16px;
    pointer-events: none;
    z-index: 2;
    transition: color 0.25s ease;
}

.vd_input-wrapper:focus-within .menu-icon {
    color: #667eea;
}

/* Focus */
input[type="email"]:focus,
input[type="password"]:focus,
select:focus {
    border-color: #667eea !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12) !important;
}

/* Validation errors */
input[type="email"].input-validation-error,
input[type="password"].input-validation-error,
select.input-validation-error {
    border-color: #e53e3e !important;
    background-color: #fff5f5 !important;
}

input[type="email"].input-validation-error:focus,
input[type="password"].input-validation-error:focus,
select.input-validation-error:focus {
    border-color: #e53e3e !important;
    background-color: #fff5f5 !important;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1) !important;
}

::placeholder {
    color: #a0aec0;
    font-weight: 400;
}

span.asterisk {
    display: none !important;
}

/* =============================================
   VALIDATION MESSAGE
   ============================================= */
.field-validation-error {
    display: block !important;
    width: 100%;
    text-align: left;
    color: #e53e3e;
    font-size: 12px;
    font-weight: 500;
    margin-top: -8px;
    margin-bottom: 10px;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    animation: shakeIn 0.3s ease;
}

.field-validation-error::before {
    content: '⚠ ';
}

/* =============================================
   ALERTS
   ============================================= */
.vd_hidden {
    display: none;
}

.alert {
    border: none;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.5;
    animation: fadeSlideDown 0.3s ease;
}

.alert-danger {
    background-color: #fff5f5;
    color: #c53030;
    border-left: 3px solid #fc8181;
}

.alert-success {
    background-color: #f0fff4;
    color: #276749;
    border-left: 3px solid #68d391;
}

/* =============================================
   REMEMBER ME CHECKBOX
   ============================================= */
.vd_checkbox {
    text-align: left;
    margin: 16px 0 20px;
    display: flex;
    align-items: center;
    animation: fadeSlideDown 0.5s ease-out 0.3s both;
}

.vd_checkbox input {
    accent-color: #667eea;
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
    margin-right: 0 !important;
}

.rememberstyl,
.vd_checkbox label {
    color: #4a5568 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    margin-left: 10px !important;
    margin-right: 3px !important;
    cursor: pointer;
    vertical-align: middle;
    position: relative;
    top: 0;
}

/* =============================================
   SUBMIT BUTTON
   ============================================= */
button,
.ui.primary.button {
    width: 100% !important;
    height: 50px !important;
    background: linear-gradient(135deg, #667eea 0%, #5a67d8 100%) !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 0 !important;
    font-family: inherit !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px !important;
    color: #ffffff !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.35) !important;
    transition: transform 0.22s ease, box-shadow 0.22s ease !important;
    position: relative !important;
    overflow: hidden !important;
}

button:hover:not(:disabled),
.ui.primary.button:hover:not(:disabled) {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.45) !important;
}

button:active:not(:disabled),
.ui.primary.button:active:not(:disabled) {
    transform: translateY(0) !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3) !important;
}

button:disabled,
.ui.primary.button:disabled {
    opacity: 0.65 !important;
    cursor: not-allowed !important;
}

button i,
.ui.primary.button i {
    font-size: 16px !important;
    margin-right: 0 !important;
}

/* =============================================
   SIGN UP FOOTER
   ============================================= */
.login-signup-footer {
    text-align: center;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #e8ecf0;
    animation: fadeSlideDown 0.5s ease-out 0.4s both;
}

.login-signup-footer span {
    color: #718096;
    font-size: 13px;
    font-weight: 500;
}

.login-signup-footer a {
    color: #667eea;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.login-signup-footer a:hover {
    color: #5a67d8;
    text-decoration: underline;
}

/* =============================================
   CAMERA POPOVER
   ============================================= */
.CameraPopover {
    width: 480px;
    height: 480px;
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.CameraPopover .camInner {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #000;
}

.CameraPopover .closeCam {
    position: absolute;
    cursor: pointer;
    right: 98px;
    top: 20px;
    z-index: 1;
    background: #4a5568;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: #fff;
    display: flex;
    justify-content: center;
    font-size: 21px;
    padding: 2px;
}

.CameraPopover canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-55%, -50%);
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes bgPulse {
    0%   { opacity: 0.55; transform: scale(1); }
    100% { opacity: 1;    transform: scale(1.06); }
}

@keyframes dotGridMove {
    0%   { background-position: 0 0; }
    100% { background-position: 40px 40px; }
}

@keyframes blobFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%       { transform: translate(28px, 18px) scale(1.06); }
    66%       { transform: translate(-18px, 10px) scale(0.96); }
}

@keyframes blobFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%       { transform: translate(-22px, -14px) scale(1.04); }
    66%       { transform: translate(14px, 22px) scale(0.97); }
}

@keyframes blobFloat3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%       { transform: translate(18px, -18px) scale(1.08); }
}

@keyframes cardEntrance {
    from { opacity: 0; transform: translateY(22px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes shimmerLine {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes shakeIn {
    0%   { transform: translateX(0); opacity: 0; }
    25%  { transform: translateX(-4px); }
    50%  { transform: translateX(4px); opacity: 1; }
    75%  { transform: translateX(-2px); }
    100% { transform: translateX(0); }
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media only screen and (max-width: 900px) {
    .columns:not(.leftcol) {
        display: none;
    }

    .login_wrap,
    .columns.leftcol {
        flex: 0 0 100%;
        width: 100%;
    }
}

@media only screen and (max-width: 500px) {
    .login_wrap {
        padding: 16px;
        background: #edf0f5;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .vd_login-page {
        max-width: 100%;
        border-radius: 16px !important;
        padding: 40px 22px 32px !important;
    }

    .heading h3 {
        font-size: 22px;
    }

    .vd_input-wrapper {
        margin-bottom: 14px;
    }

    button, .ui.primary.button {
        height: 46px !important;
        font-size: 14px !important;
    }
}
