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

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

.main-container {
    background-image: linear-gradient(rgba(226, 226, 226, 0.6), rgba(130, 76, 76, 0.6)), url('/_content/LivingThing.Core.IOT.Devices.ChickenMonitor/img/chicken.jpg');
    background-size: cover;
    background-position: center;
}

.board {
    margin: 0;
    transform: 1s ease;
}

.board:hover {
    background: rgb(255, 255, 255);
    font-weight: bold;
    box-shadow: 0px 2px 5px rgb(255, 255, 255);
    transition: 1s ease-in-out;
    border: 3px solid white;
}

.icons:hover {
    background: white;
    color: orangered;
    transition: 0.5s ease-in-out;
    border: 1px solid white;
    border-radius: 50%;
}

.icons:focus {
    background: white;
    color: orangered;
    transition: 0.2s ease-in-out;
    border: 1px solid white;
}

/* ========================================================
   CHICKENMONITOR POULTRY IOT AUTHENTICATION OVERLAY
   ======================================================== */

:root {
    --cm-primary-gradient: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    --cm-primary-glow: 0 10px 22px -4px rgba(79, 70, 229, 0.45);
    --cm-bg-canvas: #edf0f8;
    --cm-card-radius: 24px;
    --cm-inner-radius: 20px;
    --cm-input-radius: 10px;
    --cm-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --cm-text-heading: #0f172a;
    --cm-text-body: #64748b;
    --cm-text-muted: #94a3b8;
    --cm-border-color: #e2e8f0;
}

/* Hide default upload box when unauthenticated */
body.cm-unauthenticated .hv-10.stack:has(.fileupload-input),
body:not(.cm-authenticated) .hv-10.stack:has(.fileupload-input),
.cm-auth-hidden {
    display: none !important;
}

/* Overlay Background */
#cm-auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--cm-bg-canvas);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    font-family: var(--cm-font);
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

#cm-auth-overlay.cm-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Split Card */
.cm-auth-card {
    width: 100%;
    max-width: 980px;
    background: #ffffff;
    border-radius: var(--cm-card-radius);
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.08), 0 0 1px 1px rgba(15, 23, 42, 0.03);
    display: flex;
    padding: 16px;
    gap: 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Left Hero / Poultry Aurora Panel */
.cm-hero-panel {
    flex: 1.05;
    min-height: 560px;
    border-radius: var(--cm-inner-radius);
    background: 
        radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.95), transparent 50%),
        radial-gradient(circle at 85% 85%, rgba(192, 132, 252, 0.8), transparent 50%),
        radial-gradient(circle at 20% 85%, rgba(37, 99, 235, 0.85), transparent 55%),
        linear-gradient(135deg, #0f172a 0%, #1e1b4b 35%, #312e81 70%, #4338ca 100%);
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    color: #ffffff;
}

.cm-hero-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.12), transparent 60%);
    pointer-events: none;
    animation: cm-pulse-aurora 8s ease-in-out infinite alternate;
}

@keyframes cm-pulse-aurora {
    0% { transform: scale(1) rotate(0deg); }
    100% { transform: scale(1.15) rotate(15deg); }
}

.cm-brand-header {
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 2;
}

.cm-brand-emblem-svg {
    width: 42px;
    height: 42px;
    color: #ffffff;
    flex-shrink: 0;
}

.cm-brand-meta {
    display: flex;
    flex-direction: column;
}

.cm-brand-meta .cm-brand-title {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.2px;
    color: #ffffff;
}

.cm-brand-meta .cm-brand-badge {
    font-size: 11px;
    font-weight: 600;
    color: #a5b4fc;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.cm-brand-meta .cm-brand-badge::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px #22c55e;
}

.cm-hero-content {
    z-index: 2;
    margin: 24px 0;
}

.cm-hero-sublabel {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 10px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.cm-hero-title {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.25;
    color: #ffffff;
    letter-spacing: -0.5px;
    margin-bottom: 22px;
}

.cm-feature-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2;
}

.cm-feature-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 9px 14px;
    font-size: 12.5px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
}

.cm-feature-icon {
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
}

.cm-hero-footer {
    z-index: 2;
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.65);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 14px;
    line-height: 1.4;
}

/* Right Form Panel */
.cm-form-panel {
    flex: 1.1;
    padding: 36px 36px 28px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.cm-form-header-emblem {
    width: 40px;
    height: 40px;
    color: #4f46e5;
    margin-bottom: 20px;
}

.cm-form-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--cm-text-heading);
    letter-spacing: -0.6px;
    margin-bottom: 8px;
}

.cm-form-subtitle {
    font-size: 13.5px;
    color: var(--cm-text-body);
    line-height: 1.55;
    margin-bottom: 24px;
}

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

.cm-input-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--cm-text-heading);
    margin-bottom: 7px;
}

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

.cm-form-input {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid var(--cm-border-color);
    border-radius: var(--cm-input-radius);
    font-size: 14.5px;
    color: var(--cm-text-heading);
    background: #ffffff;
    outline: none;
    transition: all 0.2s ease;
    font-family: var(--cm-font);
}

.cm-form-input::placeholder {
    color: var(--cm-text-muted);
    font-size: 14px;
}

.cm-form-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.cm-form-input.cm-error {
    border-color: #ef4444;
    background: #fef2f2;
}

.cm-toggle-password {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--cm-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    transition: color 0.2s;
}

.cm-toggle-password:hover {
    color: var(--cm-text-heading);
}

.cm-toggle-password svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
}

/* Action Button */
.cm-btn-submit {
    width: 100%;
    padding: 14px;
    background: var(--cm-primary-gradient);
    color: #ffffff;
    border: none;
    border-radius: var(--cm-input-radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--cm-primary-glow);
    transition: all 0.2s ease;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--cm-font);
}

.cm-btn-submit:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 14px 26px -4px rgba(79, 70, 229, 0.55);
}

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

.cm-btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* Security Notice */
.cm-auth-security-notice {
    margin-top: 24px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
    color: var(--cm-text-body);
    line-height: 1.4;
}

.cm-auth-security-notice svg {
    width: 18px;
    height: 18px;
    stroke: #6366f1;
    fill: none;
    flex-shrink: 0;
}

/* Alerts */
.cm-alert-box {
    padding: 11px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 18px;
    display: none;
    align-items: center;
    gap: 8px;
    animation: cm-fadeIn 0.3s ease;
}

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

.cm-alert-success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

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

.cm-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: cm-spin 0.7s linear infinite;
}

@keyframes cm-spin {
    to { transform: rotate(360deg); }
}

/* Dashboard Header User Bar */
.cm-user-badge {
    position: fixed;
    top: 14px;
    right: 24px;
    z-index: 99999;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: 9999px;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    font-size: 13px;
    color: #334155;
    font-weight: 500;
    font-family: var(--cm-font);
    animation: cm-fadeIn 0.4s ease;
}

.cm-user-badge .cm-user-icon {
    width: 22px;
    height: 22px;
    background: #e0e7ff;
    color: #4338ca;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.cm-user-badge .cm-logout-btn {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 9999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--cm-font);
}

.cm-user-badge .cm-logout-btn:hover {
    background: #fecaca;
    color: #b91c1c;
}

/* Responsive */
@media (max-width: 860px) {
    .cm-auth-card {
        flex-direction: column;
        max-width: 460px;
        padding: 14px;
        gap: 18px;
    }

    .cm-hero-panel {
        min-height: auto;
        padding: 24px 20px;
    }

    .cm-hero-title {
        font-size: 22px;
        margin-bottom: 16px;
    }

    .cm-feature-list {
        display: none;
    }

    .cm-form-panel {
        padding: 8px 12px 16px;
    }

    .cm-form-title {
        font-size: 24px;
    }

    .cm-user-badge {
        top: 8px;
        right: 12px;
        padding: 4px 10px;
        font-size: 12px;
    }
}
