/* =============================================
   WAPICLOUD — Centered Premium Glassmorphic Login
   ============================================= */

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

:root {
    --green:        #22c55e;
    --green-hover:  #16a34a;
    --green-glow:   rgba(34, 197, 94, 0.2);
    --bg:           #0a0f1d;
    --surface:      rgba(15, 23, 42, 0.7); /* Semi-transparent for glassmorphism */
    --surface-2:    rgba(30, 41, 59, 0.6);
    --surface-3:    rgba(30, 41, 59, 0.9);
    --border:       rgba(255, 255, 255, 0.08);
    --border-hover: rgba(34, 197, 94, 0.3);
    --text:         #f1f5f9;
    --text-muted:   #94a3b8;
    --text-dim:     #64748b;
    --radius:       20px;
    --radius-sm:    12px;
    --transition:   0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
    height: 100%;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ── Breathtaking Tech Background ── */
.bg-image-overlay {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image: 
        linear-gradient(rgba(10, 15, 29, 0.82), rgba(10, 15, 29, 0.85)),
        url('https://images.unsplash.com/photo-1451187580459-43490279c0fa?q=80&w=1920&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: contrast(1.05);
}

/* Page Container */
.page-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(2px);
}

/* Centered Glassmorphic Login Card */
.login-card {
    width: 100%;
    max-width: 480px; /* Wider and more spacious */
    background: var(--surface);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px 40px;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 20px 25px -5px rgba(0, 0, 0, 0.2),
        inset 0 1px 1px rgba(255, 255, 255, 0.05);
    transition: transform var(--transition), box-shadow var(--transition);
}

.login-card:hover {
    box-shadow: 
        0 20px 40px -15px rgba(0, 0, 0, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.08);
}

/* Card Header & Logo */
.card-header {
    text-align: center;
    margin-bottom: 36px;
}

.logo-wrapper {
    width: 80px;
    height: 80px;
    background: #ffffff;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    padding: 12px;
    box-shadow: 
        0 10px 15px -3px rgba(0, 0, 0, 0.3),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transition: transform var(--transition);
}

.logo-wrapper:hover {
    transform: scale(1.05) rotate(2deg);
}

.card-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.card-title {
    font-size: 26px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.card-sub {
    font-size: 14px;
    color: var(--text-muted);
    letter-spacing: 0.2px;
}

/* Alert Error Style */
.alert-error {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    color: #f87171;
    font-size: 13.5px;
    padding: 12px 16px;
    margin-bottom: 24px;
}

/* Form Styling */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 550;
    color: #cbd5e1;
    margin-bottom: 8px;
    letter-spacing: 0.1px;
}

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

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    pointer-events: none;
    transition: color var(--transition);
}

.input-wrapper input {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    padding: 14px 16px 14px 44px;
    outline: none;
    transition: 
        border-color var(--transition), 
        box-shadow var(--transition), 
        background var(--transition);
}

.input-wrapper input::placeholder {
    color: var(--text-dim);
}

.input-wrapper input:focus {
    background: var(--surface-3);
    border-color: var(--green);
    box-shadow: 0 0 0 4px var(--green-glow);
}

.input-wrapper:focus-within .input-icon {
    color: var(--green);
}

/* Password Toggle Icon */
.toggle-pass {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    padding: 4px;
    transition: color var(--transition);
}

.toggle-pass:hover {
    color: var(--text-muted);
}

.field-error {
    font-size: 12px;
    color: #f87171;
    margin-top: 6px;
    display: block;
}

/* Remember me & Forgot Password */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.remember-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.remember-label input {
    display: none;
}

.custom-check {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border);
    border-radius: 5px;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
}

.remember-label input:checked + .custom-check {
    background: var(--green);
    border-color: var(--green);
}

.remember-label input:checked + .custom-check::after {
    content: '✓';
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
}

.forgot-link {
    font-size: 13.5px;
    color: var(--green);
    text-decoration: none;
    font-weight: 500;
    transition: opacity var(--transition);
}

.forgot-link:hover {
    opacity: 0.8;
}

/* Submit Button */
.btn-login {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--green);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    padding: 14px;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 4px 14px var(--green-glow);
}

.btn-login:hover:not(:disabled) {
    background: var(--green-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.35);
}

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

.btn-login.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-arrow {
    transition: transform var(--transition);
    flex-shrink: 0;
}

.btn-login:hover .btn-arrow {
    transform: translateX(3px);
}

/* Footer Section */
.card-footer {
    margin-top: 32px;
    text-align: center;
    border-top: 1px solid var(--border);
    padding-top: 24px;
}

.card-footer p {
    font-size: 13.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.card-footer a {
    color: var(--green);
    font-weight: 600;
    text-decoration: none;
    transition: opacity var(--transition);
}

.card-footer a:hover {
    opacity: 0.8;
}

.footer-badges {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-dim);
}

/* ── Mobile Responsive ── */
@media (max-width: 520px) {
    .login-card {
        padding: 32px 24px;
        border-radius: var(--radius-sm);
    }
    .card-title {
        font-size: 22px;
    }
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}
