/* ============================================
   LOGIN PAGE STYLES - CHEMICAL DISTRIBUTION
   Deep Navy + Gold + Teal Premium Theme
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&display=swap');

/* ============================================
   RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
}

body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
    background-color: #0f172a;
    color: #fefce8;
}

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

/* Card fade in */
@-webkit-keyframes fadeInUp {
    0% {
        opacity: 0;
        -webkit-transform: translateY(20px);
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
}
@keyframes fadeInUp {
    0% {
        opacity: 0;
        -webkit-transform: translateY(20px);
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
}

/* Shake animation */
@-webkit-keyframes shake {
    0%, 100% { -webkit-transform: translateX(0); transform: translateX(0); }
    20% { -webkit-transform: translateX(-4px); transform: translateX(-4px); }
    40% { -webkit-transform: translateX(4px); transform: translateX(4px); }
    60% { -webkit-transform: translateX(-4px); transform: translateX(-4px); }
    80% { -webkit-transform: translateX(4px); transform: translateX(4px); }
}
@keyframes shake {
    0%, 100% { -webkit-transform: translateX(0); transform: translateX(0); }
    20% { -webkit-transform: translateX(-4px); transform: translateX(-4px); }
    40% { -webkit-transform: translateX(4px); transform: translateX(4px); }
    60% { -webkit-transform: translateX(-4px); transform: translateX(-4px); }
    80% { -webkit-transform: translateX(4px); transform: translateX(4px); }
}

/* Fade in */
@-webkit-keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}
@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Spinner */
@-webkit-keyframes spin {
    0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
    100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}
@keyframes spin {
    0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
    100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}

/* ============================================
   TRUCK ANIMATION - Smooth horizontal movement
   ============================================ */
@-webkit-keyframes truckMove {
    0% {
        -webkit-transform: translateX(-15px);
        transform: translateX(-15px);
    }
    50% {
        -webkit-transform: translateX(15px);
        transform: translateX(15px);
    }
    100% {
        -webkit-transform: translateX(-15px);
        transform: translateX(-15px);
    }
}
@keyframes truckMove {
    0% {
        -webkit-transform: translateX(-15px);
        transform: translateX(-15px);
    }
    50% {
        -webkit-transform: translateX(15px);
        transform: translateX(15px);
    }
    100% {
        -webkit-transform: translateX(-15px);
        transform: translateX(-15px);
    }
}

/* ============================================
   MAIN LAYOUT
   ============================================ */
.login-page {
    min-height: 100vh;
    width: 100%;
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -moz-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 20px;
}

/* ============================================
   BACKGROUND LAYERS
   ============================================ */
.bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Abstrak bahan kimia: kisi molekul heksagonal + glow node (self-contained, tanpa gambar eksternal) */
    background-color: #0b1120;
    background-image:
        radial-gradient(circle at 16% 26%, rgba(45, 212, 191, 0.20), transparent 42%),
        radial-gradient(circle at 84% 72%, rgba(234, 179, 8, 0.16), transparent 44%),
        radial-gradient(circle at 62% 18%, rgba(56, 189, 248, 0.12), transparent 40%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 56 100'%3E%3Cg fill='none' stroke='%23eab308' stroke-opacity='0.14' stroke-width='1.5'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 100'/%3E%3Cpath d='M28 0L28 34L0 50M28 34L56 50'/%3E%3C/g%3E%3Cg fill='%232dd4bf' fill-opacity='0.18'%3E%3Ccircle cx='28' cy='0' r='2.2'/%3E%3Ccircle cx='0' cy='16' r='2.2'/%3E%3Ccircle cx='56' cy='16' r='2.2'/%3E%3Ccircle cx='28' cy='34' r='2.2'/%3E%3Ccircle cx='0' cy='50' r='2.2'/%3E%3Ccircle cx='56' cy='50' r='2.2'/%3E%3Ccircle cx='28' cy='66' r='2.2'/%3E%3C/g%3E%3C/svg%3E");
    background-size: cover, cover, cover, 56px 100px;
    background-position: center center, center center, center center, center center;
    background-repeat: no-repeat, no-repeat, no-repeat, repeat;
    z-index: 1;
}

.bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 12, 21, 0.70);
    background: -webkit-linear-gradient(315deg, rgba(8, 12, 21, 0.78) 0%, rgba(15, 23, 42, 0.62) 50%, rgba(8, 12, 21, 0.78) 100%);
    background: -moz-linear-gradient(315deg, rgba(8, 12, 21, 0.78) 0%, rgba(15, 23, 42, 0.62) 50%, rgba(8, 12, 21, 0.78) 100%);
    background: -o-linear-gradient(315deg, rgba(8, 12, 21, 0.78) 0%, rgba(15, 23, 42, 0.62) 50%, rgba(8, 12, 21, 0.78) 100%);
    background: linear-gradient(135deg, rgba(8, 12, 21, 0.78) 0%, rgba(15, 23, 42, 0.62) 50%, rgba(8, 12, 21, 0.78) 100%);
    z-index: 2;
}

/* ============================================
   LOGIN CARD
   ============================================ */
.login-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
    background-color: rgba(30, 41, 59, 0.97);
    border: 1px solid rgba(71, 85, 105, 0.4);
    -webkit-border-radius: 16px;
    -moz-border-radius: 16px;
    border-radius: 16px;
    -webkit-box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    -moz-box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    -webkit-animation: fadeInUp 0.4s ease-out;
    -moz-animation: fadeInUp 0.4s ease-out;
    -o-animation: fadeInUp 0.4s ease-out;
    animation: fadeInUp 0.4s ease-out;
}

.login-card.shake {
    -webkit-animation: shake 0.4s ease-in-out;
    -moz-animation: shake 0.4s ease-in-out;
    -o-animation: shake 0.4s ease-in-out;
    animation: shake 0.4s ease-in-out;
}

/* ============================================
   CARD HEADER
   ============================================ */
.card-header-custom {
    padding: 32px 32px 16px 32px;
    text-align: center;
    border-bottom: none;
    background: transparent;
}

/* Logo */
.logo-wrap {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -moz-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    margin-bottom: 16px;
}

.logo-circle {
    width: 90px;
    height: 90px;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
    background-color: rgba(51, 65, 85, 0.6);
    border: 1px solid rgba(71, 85, 105, 0.4);
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -moz-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    padding: 12px;
}

.logo-circle img {
    width: 100%;
    height: 100%;
    -o-object-fit: contain;
    object-fit: contain;
}

/* Illustration Container */
.illustration-wrap {
    width: 100%;
    height: 90px;
    margin-bottom: 16px;
    overflow: hidden;
}

/* Animated Truck */
.truck-animated {
    display: block;
    width: 100%;
    height: 100%;
    -webkit-animation: truckMove 8s ease-in-out infinite;
    -moz-animation: truckMove 8s ease-in-out infinite;
    -o-animation: truckMove 8s ease-in-out infinite;
    animation: truckMove 8s ease-in-out infinite;
}

/* Welcome Text */
.welcome-title {
    font-size: 24px;
    font-weight: 700;
    color: #fefce8;
    margin: 0 0 4px 0;
}

.welcome-subtitle {
    font-size: 14px;
    color: #94a3b8;
    margin: 0;
}

/* ============================================
   CARD BODY
   ============================================ */
.card-body-custom {
    padding: 16px 32px 32px 32px;
}

/* ============================================
   ALERT MESSAGES
   ============================================ */
.alert-box {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 20px;
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    border-radius: 10px;
    font-size: 14px;
    -webkit-animation: fadeIn 0.25s ease-out;
    -moz-animation: fadeIn 0.25s ease-out;
    -o-animation: fadeIn 0.25s ease-out;
    animation: fadeIn 0.25s ease-out;
}

.alert-box svg {
    width: 18px;
    height: 18px;
    -webkit-flex-shrink: 0;
    -moz-flex-shrink: 0;
    -ms-flex-negative: 0;
    flex-shrink: 0;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
}

.alert-success {
    background-color: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #4ade80;
}

.alert-warning {
    background-color: rgba(234, 179, 8, 0.12);
    border: 1px solid rgba(234, 179, 8, 0.25);
    color: #facc15;
}

.alert-info {
    background-color: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: #60a5fa;
}

/* ============================================
   FORM STYLES
   ============================================ */
.login-form {
    width: 100%;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #fefce8;
    margin-bottom: 8px;
}

/* Label row with forgot password */
.label-row {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    -moz-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    margin-bottom: 8px;
}

.forgot-link {
    font-size: 13px;
    color: #eab308;
    text-decoration: none;
    -webkit-transition: color 0.2s ease;
    -moz-transition: color 0.2s ease;
    -o-transition: color 0.2s ease;
    transition: color 0.2s ease;
}

.forgot-link:hover {
    color: #facc15;
    text-decoration: underline;
}

/* Input wrapper */
.input-wrap {
    position: relative;
    width: 100%;
}

.input-icon-left {
    position: absolute;
    left: 14px;
    top: 50%;
    -webkit-transform: translateY(-50%);
    -moz-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    -o-transform: translateY(-50%);
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #64748b;
    pointer-events: none;
}

.input-icon-left svg {
    width: 18px;
    height: 18px;
    stroke: #64748b;
    stroke-width: 2;
    fill: none;
}

/* Input field */
.form-input {
    display: block;
    width: 100%;
    height: 48px;
    padding: 12px 14px 12px 44px;
    font-family: inherit;
    font-size: 16px;
    color: #fefce8;
    background-color: #1e293b;
    border: 1px solid #334155;
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    border-radius: 10px;
    outline: none;
    -webkit-transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -moz-transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -o-transition: border-color 0.2s ease, box-shadow 0.2s ease;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input::-webkit-input-placeholder { color: #64748b; }
.form-input::-moz-placeholder { color: #64748b; opacity: 1; }
.form-input:-ms-input-placeholder { color: #64748b; }
.form-input::placeholder { color: #64748b; }

.form-input:focus {
    border-color: #eab308;
    -webkit-box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.2);
    -moz-box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.2);
    box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.2);
}

.form-input.input-error {
    border-color: #ef4444;
    -webkit-box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
    -moz-box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.form-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Password with toggle */
.form-input.has-toggle {
    padding-right: 44px;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    -webkit-transform: translateY(-50%);
    -moz-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    -o-transform: translateY(-50%);
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    -webkit-transition: color 0.15s ease;
    -moz-transition: color 0.15s ease;
    -o-transition: color 0.15s ease;
    transition: color 0.15s ease;
}

.toggle-password:hover {
    color: #fefce8;
}

.toggle-password:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.toggle-password svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* ============================================
   CHECKBOX - Remember Me
   ============================================ */
.checkbox-wrap {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.checkbox-input {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: #eab308;
}

.checkbox-label {
    font-size: 14px;
    color: #94a3b8;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* ============================================
   SUBMIT BUTTON
   ============================================ */
.btn-login {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -moz-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 50px;
    padding: 0 20px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    background-color: #eab308;
    border: none;
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    border-radius: 10px;
    cursor: pointer;
    -webkit-transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    -moz-transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    -o-transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.btn-login:hover {
    background-color: #facc15;
    -webkit-box-shadow: 0 8px 20px -4px rgba(234, 179, 8, 0.35);
    -moz-box-shadow: 0 8px 20px -4px rgba(234, 179, 8, 0.35);
    box-shadow: 0 8px 20px -4px rgba(234, 179, 8, 0.35);
    -webkit-transform: translateY(-1px);
    -moz-transform: translateY(-1px);
    -ms-transform: translateY(-1px);
    -o-transform: translateY(-1px);
    transform: translateY(-1px);
}

.btn-login:active {
    -webkit-transform: translateY(0);
    -moz-transform: translateY(0);
    -ms-transform: translateY(0);
    -o-transform: translateY(0);
    transform: translateY(0);
    -webkit-box-shadow: 0 4px 12px -2px rgba(234, 179, 8, 0.4);
    -moz-box-shadow: 0 4px 12px -2px rgba(234, 179, 8, 0.4);
    box-shadow: 0 4px 12px -2px rgba(234, 179, 8, 0.4);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ============================================
   FOOTER
   ============================================ */
.card-footer-custom {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(71, 85, 105, 0.3);
    text-align: center;
}

.card-footer-custom p {
    font-size: 12px;
    color: #64748b;
    margin: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media screen and (max-width: 480px) {
    .login-page {
        padding: 16px;
    }
    
    .card-header-custom {
        padding: 24px 24px 12px 24px;
    }
    
    .card-body-custom {
        padding: 12px 24px 24px 24px;
    }
    
    .logo-circle {
        width: 80px;
        height: 80px;
    }
    
    .illustration-wrap {
        height: 80px;
    }
    
    .welcome-title {
        font-size: 20px;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    * {
        -webkit-animation-duration: 0.01ms !important;
        -moz-animation-duration: 0.01ms !important;
        -o-animation-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        -webkit-transition-duration: 0.01ms !important;
        -moz-transition-duration: 0.01ms !important;
        -o-transition-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
