/* 
   style.css - Desain Sistem & Gaya Halaman Login 
   SIPDA BPBD Kabupaten Tasikmalaya
*/

:root {
    /* Brand Color System (Orange Accents) */
    --brand-primary: hsl(25, 99%, 55%);       /* #FE7B1C */
    --brand-hover: hsl(25, 99%, 47%);         /* Darker Orange */
    --brand-light: hsl(25, 100%, 94%);        /* Soft Orange tint for focus borders */
    --brand-glow: hsla(25, 99%, 55%, 0.15);   /* Glowing shadow */
    
    /* Neutral Color System */
    --bg-page: #F8F9FF;                       /* Matching SVG main background #F8F9FF */
    --bg-card: #FFFFFF;                       /* Pure White */
    --text-main: hsl(222, 47%, 11%);          /* #0F172A - Very Dark Slate */
    --text-muted: hsl(215, 16%, 47%);         /* #64748B - Slate Gray */
    --text-light: hsl(215, 25%, 27%);         /* Darker Slate Gray */
    --border-color: hsl(214, 32%, 91%);       /* #E2E8F0 - Soft Gray Border */
    --input-bg: hsl(220, 14%, 96%);           /* Very light gray/blue background for fields */
    --input-focus-border: hsl(25, 99%, 65%);
    
    /* Semantic Colors */
    --danger: hsl(0, 84%, 60%);               /* Red alert */
    --danger-light: hsl(0, 100%, 96%);        /* Red alert background */
    --success: hsl(142, 72%, 29%);            /* Green success */
    
    /* Transitions & Radii */
    --radius-card: 12px;                      /* Clean modern card roundness */
    --radius-input: 8px;                      /* Input corner roundness */
    --shadow-card: 0 10px 30px -10px rgba(15, 23, 42, 0.08), 
                   0 1px 3px rgba(15, 23, 42, 0.03);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Background Ambient Blurred Blobs (matching SVG specs) */
.ambient-blob {
    position: absolute;
    border-radius: 12px;
    opacity: 0.035;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}

.blob-top-left {
    left: -50px;
    top: -50px;
    width: 512px;
    height: 409px;
    background-color: #55589A; /* Purple/indigo blob matching SVG opacity */
}

.blob-bottom-right {
    right: -50px;
    bottom: -50px;
    width: 512px;
    height: 409px;
    background-color: #9A4600; /* Orange/brown blob matching SVG opacity */
}

/* Layout Wrapper */
.login-wrapper {
    width: 100%;
    max-width: 1280px;
    padding: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

/* Card Container (exact dimensions from SVG specifications) */
.login-card {
    background-color: var(--bg-card);
    width: 100%;
    max-width: 447px;           /* Exact SVG width */
    min-height: 660px;          /* Exact SVG height */
    padding: 40px 36px;
    border-radius: var(--radius-card);
    border: 1px solid var(--border-color); /* stroke="#E2E8F0" */
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition-normal);
}

/* Logo Header Group */
.card-header {
    text-align: center;
    margin-bottom: 24px;
}

.logo-container {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 16px;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.logo-container:hover {
    transform: scale(1.08) rotate(3deg);
}

.brand-logo {
    display: block;
    object-fit: contain;
}

.brand-title {
    font-family: 'Outfit', sans-serif;
    font-size: 26px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.03em;
    margin-bottom: 6px;
}

.brand-title .highlight {
    color: var(--brand-primary); /* Orange accent */
}

.brand-subtitle {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-muted);
    line-height: 1.4;
    padding: 0 12px;
}

/* Alert/Toast Component */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--danger-light);
    border: 1px solid hsla(0, 84%, 60%, 0.15);
    padding: 10px 14px;
    border-radius: var(--radius-input);
    color: var(--danger);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease forwards;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.alert-hidden {
    display: none;
    opacity: 0;
    transform: translateY(-8px);
}

.alert-icon {
    font-size: 16px;
}

/* Input Styles */
.form-group {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
}

.label-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
}

.forgot-link {
    font-size: 12px;
    font-weight: 600;
    color: var(--brand-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.forgot-link:hover {
    color: var(--brand-hover);
    text-decoration: underline;
}

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

.input-icon {
    position: absolute;
    left: 14px;
    font-size: 18px;
    color: var(--text-muted);
    pointer-events: none;
    transition: var(--transition-fast);
}

.form-control {
    width: 100%;
    padding: 12px 14px 12px 42px; /* Extra padding left for icon */
    background-color: var(--input-bg);
    border: 1px solid transparent;
    border-radius: var(--radius-input);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
    outline: none;
    transition: var(--transition-fast);
}

.form-control::placeholder {
    color: hsl(215, 14%, 70%);
}

/* Focused input state with soft glow */
.form-control:focus {
    background-color: var(--bg-card);
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

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

/* Input suffix toggle password visibility */
.btn-toggle {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    transition: var(--transition-fast);
    padding: 4px;
}

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

/* Premium Custom Checkbox Styles */
.form-options {
    margin-bottom: 24px;
}

.checkbox-container {
    display: inline-flex;
    align-items: center;
    position: relative;
    padding-left: 28px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: var(--transition-fast);
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--brand-primary);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.checkmark::after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark::after {
    display: block;
}

.checkbox-container .checkmark::after {
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label {
    transition: var(--transition-fast);
}

.checkbox-container:hover .checkbox-label {
    color: var(--text-main);
}

/* Submit Button */
.btn-submit {
    width: 100%;
    background-color: var(--brand-primary);
    color: #FFFFFF;
    border: none;
    padding: 13px 20px;
    border-radius: var(--radius-input);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    transition: var(--transition-normal);
}

.btn-submit:hover {
    background-color: var(--brand-hover);
    box-shadow: 0 4px 12px var(--brand-glow);
}

.btn-submit:active {
    transform: scale(0.98);
}

.btn-icon-arrow {
    font-size: 16px;
    transition: transform 0.2s ease;
}

.btn-submit:hover .btn-icon-arrow {
    transform: translateX(4px);
}

/* Loading state for button */
.btn-submit.btn-loading {
    background-color: var(--brand-hover);
    pointer-events: none;
}

.btn-submit.btn-loading .btn-text,
.btn-submit.btn-loading .btn-icon-arrow {
    opacity: 0;
}

.spinner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.spinner-hidden {
    opacity: 0;
    display: none;
}

/* Footer Section */
.card-footer {
    text-align: center;
    margin-top: 32px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    line-height: 1.6;
}

.footer-muted {
    font-size: 11px;
    color: hsl(215, 14%, 70%);
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsiveness Media Queries */
@media (max-width: 480px) {
    .login-card {
        min-height: auto;
        padding: 32px 24px;
        border-radius: 0;
        border: none;
        box-shadow: none;
        background: transparent;
    }
    
    body {
        background-color: #FFFFFF;
        align-items: flex-start;
    }
    
    .login-wrapper {
        padding: 0;
    }
    
    .ambient-blob {
        display: none;
    }
}

/* Custom Validation Tooltip */
.custom-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    left: 4px;
    background-color: #ffffff;
    border: 1.5px solid var(--brand-primary);
    border-radius: 8px;
    padding: 8px 12px;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.1), 
                0 8px 16px -6px rgba(15, 23, 42, 0.05);
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    animation: tooltipFadeIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Tooltip Arrow */
.custom-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 20px;
    border: 6px solid transparent;
    border-bottom-color: var(--brand-primary);
}

.custom-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 21px;
    border: 5px solid transparent;
    border-bottom-color: #ffffff;
}

/* Tooltip Icon Block */
.tooltip-icon-box {
    background-color: var(--brand-primary);
    color: #ffffff;
    width: 20px;
    height: 20px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.tooltip-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

