/* ================================================
   Systema Login Page - Minimalist Center Card Design
   ================================================ */

/* CSS Variables */
:root {
    /* Systema Green Theme */
    --primary-green: #00a651;
    --accent-green: #00b559;
    --light-green: #0adb6a;
    --dark-green: #165a3a;
    --darker-green: #0a1f14;
    
    /* Light Mode Colors */
    --bg-light: #f5f7f6;
    --card-bg: #ffffff;
    --border-color: #e0e5e3;
    --text-primary: #1a1f1c;
    --text-secondary: #4a5854;
    --text-muted: #7a8883;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.08);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    min-height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f9f7;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    color: var(--text-primary);
    padding: 1rem 0;
}

/* Background Decorative Circles */
body::before,
body::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    opacity: 0.4;
    filter: blur(80px);
    pointer-events: none;
}

body::before {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 166, 81, 0.2) 0%, transparent 70%);
    top: -200px;
    right: -200px;
}

body::after {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 181, 89, 0.15) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
}

/* Main Login Container */
.login-wrapper {
    max-width: 440px;
    width: 100%;
    padding: 1rem;
    position: relative;
    z-index: 1;
}

/* Login Card */
.login-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    margin: auto;
}

/* Logo Section */
.logo-section {
    text-align: center;
    margin-bottom: 1.5rem;
}

.logo-image {
    height: 48px;
    width: auto;
    margin-bottom: 0.75rem;
}

.brand-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.brand-tagline {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Welcome Heading */
.welcome-heading {
    text-align: center;
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.welcome-subtitle {
    text-align: center;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

/* Error Messages */
.error {
    background: #fef2f2;
    color: #dc2626;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #fecaca;
    font-size: 13px;
}

/* Form Groups */
.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
}

/* Input Fields */
input[type="text"],
input[type="password"],
input[type="number"] {
    width: 100%;
    padding: 0.75rem 0.875rem;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9375rem;
    transition: all 0.2s;
    background: var(--card-bg);
    color: var(--text-primary);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.1);
}

input::placeholder {
    color: var(--text-muted);
}

/* Password Toggle */
.password-wrapper {
    position: relative;
}

.password-wrapper input[type="password"],
.password-wrapper input[type="text"] {
    padding-right: 44px;
}

.toggle-password {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    transition: color 0.2s;
}

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

/* CAPTCHA Styles */
.captcha-group {
    margin-bottom: 1rem;
}

.captcha-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f9fafb;
    padding: 10px;
    border-radius: 8px;
    border: 1.5px solid var(--border-color);
    justify-content: center;
}

#captchaCanvas {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    max-width: 100%;
    height: auto;
}

.btn-refresh-captcha {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--accent-green) 100%);
    color: white;
    border: none;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
}

.btn-refresh-captcha:hover {
    background: var(--dark-green);
    transform: rotate(180deg);
}

.captcha-input {
    width: 100% !important;
    text-align: center;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 3px;
    margin-top: 10px;
}

.captcha-hint {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}

/* Google reCAPTCHA */
.g-recaptcha {
    transform: scale(1);
    transform-origin: 0 0;
    margin: 0;
}

@media (max-width: 400px) {
    .g-recaptcha {
        transform: scale(0.88);
        transform-origin: 0 0;
    }
}

@media (max-width: 360px) {
    .g-recaptcha {
        transform: scale(0.8);
        transform-origin: 0 0;
    }
}

/* Rate Limit Warning */
.rate-limit-warning {
    background: #fef3c7;
    color: #92400e;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid #fde68a;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rate-limit-warning i {
    font-size: 16px;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.forgot-password {
    color: var(--primary-green);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.forgot-password:hover {
    color: var(--dark-green);
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 10px;
}

.remember-me label {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
    cursor: pointer;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5e7eb;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary-green);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Login Button */
.btn-login {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--accent-green) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 1rem;
}

.btn-login:hover {
    background: linear-gradient(135deg, var(--dark-green) 0%, var(--primary-green) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 166, 81, 0.3);
}

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

/* Footer */
.login-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 0.5rem 0;
    }

    body::before,
    body::after {
        display: none;
    }

    .login-wrapper {
        padding: 0.5rem;
    }

    .login-card {
        padding: 1.25rem;
    }

    .logo-section {
        margin-bottom: 0.75rem;
    }

    .logo-image {
        height: 36px;
        margin-bottom: 0.375rem;
    }

    .welcome-heading {
        font-size: 1.25rem;
        margin-bottom: 0.25rem;
    }

    .welcome-subtitle {
        font-size: 0.8125rem;
        margin-bottom: 1rem;
        line-height: 1.3;
    }

    .form-group {
        margin-bottom: 0.75rem;
    }

    label {
        margin-bottom: 0.3rem;
        font-size: 0.75rem;
    }

    input[type="text"],
    input[type="password"] {
        padding: 0.625rem 0.75rem;
        font-size: 0.875rem;
    }

    .btn-login {
        padding: 0.625rem;
        font-size: 0.875rem;
        margin-bottom: 0.75rem;
    }

    .error {
        padding: 10px 12px;
        margin-bottom: 0.75rem;
        font-size: 12px;
    }

    .captcha-container {
        padding: 8px;
        gap: 8px;
    }

    #captchaCanvas {
        width: 160px !important;
        height: 50px !important;
    }

    .btn-refresh-captcha {
        min-width: 32px;
        height: 32px;
        padding: 6px 8px;
        font-size: 12px;
    }

    .captcha-input {
        margin-top: 8px;
        padding: 0.625rem;
        font-size: 14px;
        letter-spacing: 2px;
    }

    .captcha-hint {
        font-size: 10px;
        margin-top: 4px;
    }

    .rate-limit-warning {
        padding: 8px 10px;
        margin-bottom: 10px;
        font-size: 11px;
    }

    .login-footer {
        margin-top: 0.625rem;
        padding-top: 0.625rem;
        font-size: 0.6875rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0.25rem 0;
    }

    .login-wrapper {
        padding: 0.25rem;
    }

    .login-card {
        padding: 1rem;
        border-radius: 12px;
    }

    .logo-section {
        margin-bottom: 0.5rem;
    }

    .logo-image {
        height: 32px;
        margin-bottom: 0.25rem;
    }

    .welcome-heading {
        font-size: 1.125rem;
        margin-bottom: 0.25rem;
    }

    .welcome-subtitle {
        font-size: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .form-group {
        margin-bottom: 0.625rem;
    }

    label {
        margin-bottom: 0.25rem;
        font-size: 0.6875rem;
    }

    input[type="text"],
    input[type="password"] {
        padding: 0.5rem 0.625rem;
        font-size: 0.8125rem;
    }

    .btn-login {
        padding: 0.5rem;
        font-size: 0.8125rem;
        margin-bottom: 0.5rem;
    }

    #captchaCanvas {
        width: 140px !important;
        height: 45px !important;
    }

    .captcha-input {
        padding: 0.5rem;
        font-size: 13px;
    }

    .login-footer {
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        font-size: 0.625rem;
    }
}

/* Extra responsive untuk layar sangat kecil */
@media (max-width: 360px) {
    body {
        padding: 0;
    }

    .login-wrapper {
        padding: 0.25rem;
    }

    .login-card {
        padding: 0.875rem;
    }

    .logo-image {
        height: 28px;
    }

    .welcome-heading {
        font-size: 1rem;
    }

    .welcome-subtitle {
        font-size: 0.6875rem;
        margin-bottom: 0.5rem;
    }

    #captchaCanvas {
        width: 120px !important;
        height: 40px !important;
    }
}

/* Handle layar dengan tinggi kecil (landscape mode) */
@media (max-height: 700px) {
    body {
        padding: 0.5rem 0;
    }

    .login-card {
        padding: 1.25rem;
    }

    .logo-section {
        margin-bottom: 0.75rem;
    }

    .logo-image {
        height: 36px;
    }

    .welcome-heading {
        font-size: 1.25rem;
        margin-bottom: 0.25rem;
    }

    .welcome-subtitle {
        margin-bottom: 0.875rem;
    }

    .form-group {
        margin-bottom: 0.75rem;
    }

    .login-footer {
        margin-top: 0.625rem;
        padding-top: 0.625rem;
    }
}

@media (max-height: 600px) {
    body {
        padding: 0.25rem 0;
    }

    .login-card {
        padding: 1rem;
    }

    .logo-section {
        margin-bottom: 0.5rem;
    }

    .logo-image {
        height: 30px;
    }

    .welcome-heading {
        font-size: 1.125rem;
        margin-bottom: 0.25rem;
    }

    .welcome-subtitle {
        font-size: 0.8125rem;
        margin-bottom: 0.625rem;
    }

    .form-group {
        margin-bottom: 0.5rem;
    }

    label {
        margin-bottom: 0.25rem;
    }

    input[type="text"],
    input[type="password"] {
        padding: 0.5rem 0.625rem;
    }

    .btn-login {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .login-footer {
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        font-size: 0.6875rem;
    }
}
