/* ============================================
   PTSP Users — Login Stylesheet (Clean Mode)
   ============================================ */

:root {
    --primary: #0a1628;
    --primary-light: #1a2a4a;
    --accent: #4a9eff;
    --gold: #c9a84c;
    --radius-card: 24px;
    --radius-input: 12px;
    --shadow-card: 0 25px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 16px;
    position: relative;
    overflow: hidden;
    color: #111827;
}

/* Background Effects */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at 20% 50%, rgba(74, 158, 255, 0.08) 0%, transparent 60%),
                radial-gradient(ellipse at 80% 50%, rgba(201, 168, 76, 0.06) 0%, transparent 60%),
                radial-gradient(ellipse at 50% 100%, rgba(74, 158, 255, 0.05) 0%, transparent 40%);
    z-index: 0;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: repeating-linear-gradient(45deg, transparent, transparent 40px, rgba(255, 255, 255, 0.02) 40px, rgba(255, 255, 255, 0.02) 41px),
                      repeating-linear-gradient(-45deg, transparent, transparent 40px, rgba(255, 255, 255, 0.02) 40px, rgba(255, 255, 255, 0.02) 41px);
    z-index: 0;
    pointer-events: none;
}

.watermark {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Georgia', serif;
    font-weight: 900;
    font-size: clamp(120px, 40vw, 300px);
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.03);
    z-index: 0;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
}

/* Wrapper & Card */
.login-wrapper {
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-card);
    padding: 40px 36px;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    animation: cardIn 0.5s ease-out;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--gold), var(--accent), var(--gold));
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

/* Ministry Emblem */
.ministry-emblem {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding-bottom: 20px;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.emblem-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 20px;
    flex-shrink: 0;
    border: 2px solid var(--gold);
}

.emblem-text {
    text-align: left;
    line-height: 1.2;
}

.emblem-text .ministry {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.emblem-text .sub-ministry {
    display: block;
    font-size: 9px;
    color: #6b7a8f;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Brand */
.brand {
    text-align: center;
    margin-bottom: 28px;
}

.brand h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.brand h1 span {
    color: var(--gold);
}

.brand .subtitle {
    color: #6b7a8f;
    font-size: 13px;
    margin-top: 4px;
}

.brand .subtitle i {
    color: var(--gold);
    font-size: 12px;
}

/* Alerts */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-input);
    border: none;
    border-left: 4px solid transparent;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
}

.alert i {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border-left-color: #ef4444;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border-left-color: #22c55e;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.input-wrap {
    position: relative;
}

.input-wrap input {
    width: 100%;
    height: 48px;
    padding: 0 44px 0 16px;
    border: 2px solid #e5e7eb;
    border-radius: var(--radius-input);
    font-size: 15px;
    font-family: inherit;
    background: #fafafa;
    color: #111827;
    outline: none;
    transition: all 0.2s ease;
}

.input-wrap input:focus {
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(74, 158, 255, 0.08);
}

.input-wrap input::placeholder {
    color: #9ca3af;
}

/* Toggle Password — posisi dihitung dari tinggi input (48px → top 24px) */
.toggle-password {
    position: absolute;
    right: 8px;
    top: 24px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 18px;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.toggle-password:hover,
.toggle-password:focus-visible {
    color: var(--primary);
    background: rgba(0, 0, 0, 0.05);
    outline: none;
}

/* Error Text */
.field-error {
    color: #dc2626;
    font-size: 12px;
    line-height: 1.4;
    margin-top: 6px;
    display: none;
}

.field-error.show {
    display: block;
}

.field-error::before {
    content: '⚠ ';
    font-size: 11px;
}

/* Submit Button */
.btn-login {
    width: 100%;
    min-height: 50px;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border: none;
    border-radius: var(--radius-input);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn-login::after {
    content: '';
    position: absolute;
    inset: 0;
    left: -100%;
    width: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.6s ease;
}

.btn-login:hover::after { left: 100%; }
.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(26, 35, 50, 0.3);
}
.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(26, 35, 50, 0.2);
}
.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ============================================
   RESPONSIVE — MOBILE (≤ 480px)
   ============================================ */
@media (max-width: 480px) {
    body {
        padding: 12px;
        align-items: flex-start;
        padding-top: 24px;
    }

    .login-card {
        padding: 28px 22px;
        border-radius: 20px;
    }

    .ministry-emblem {
        padding-bottom: 16px;
        margin-bottom: 20px;
    }

    .emblem-icon {
        width: 38px; height: 38px; font-size: 18px;
    }

    .brand { margin-bottom: 22px; }
    .brand h1 { font-size: 21px; }

    .input-wrap input { height: 46px; font-size: 15px; }
    .toggle-password { top: 23px; }

    .btn-login { min-height: 48px; font-size: 15px; }
    .alert { font-size: 12px; padding: 10px 12px; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}