/* --- Variables & Font --- */
:root {
    --asm-primary: #2a6b52;       /* Brand Green */
    --asm-secondary: #1e4d3b;     /* Darker Green */
    --asm-dark: #333333;          /* Dark Text/Button */
    --asm-bg-input: #f7f7f7;
    --asm-font-main: 'Outfit', sans-serif;
}

body.asm-restricted-mode { overflow: hidden; }

/* --- Overlay --- */
.asm-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(30, 77, 59, 0.75);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex; justify-content: center; align-items: center;
    padding: 15px;
    box-sizing: border-box;
}

/* --- Container --- */
.asm-popup-container {
    background: #ffffff;
    padding: 40px;
    width: 480px;
    max-width: 100%;
    position: relative;
    box-shadow: 0 30px 60px rgba(0,0,0,0.3);
    border-radius: 4px;
    font-family: var(--asm-font-main);
    animation: asmFadeIn 0.3s ease-out;
    box-sizing: border-box;
}

@keyframes asmFadeIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- FLEXBOX CENTERING FIX (New) --- */
.asm-msg-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center; /* Horizontally Center */
    justify-content: center;
    text-align: center;
    width: 100%;
}

.asm-icon-area {
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.asm-msg-text-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- Typography --- */
.asm-form-box h2 {
    font-family: var(--asm-font-main);
    font-size: 28px;
    color: var(--asm-dark);
    margin: 0 0 15px 0;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}
.asm-subtitle { 
    color: #666; margin-bottom: 30px; font-size: 16px; text-align: center; line-height: 1.5;
}

/* --- Inputs --- */
.asm-form-box input {
    width: 100%; padding: 15px; margin-bottom: 15px;
    border: 1px solid #e0e0e0; background: var(--asm-bg-input);
    border-radius: 4px; box-sizing: border-box; font-size: 15px;
    font-family: var(--asm-font-main); color: var(--asm-dark);
    transition: all 0.3s;
}
.asm-form-box input:focus {
    border-color: var(--asm-primary); background: #fff; outline: none;
    box-shadow: 0 0 0 2px rgba(42, 107, 82, 0.1);
}

.asm-grid { display: flex; gap: 15px; }

/* --- Buttons --- */
button[type="submit"], .asm-dark-btn {
    width: 100%; padding: 16px;
    background: var(--asm-primary); color: #fff;
    border: none; border-radius: 4px;
    font-weight: 500; font-size: 15px; letter-spacing: 1px;
    cursor: pointer; transition: background 0.3s;
    font-family: var(--asm-font-main);
    display: flex; justify-content: center; align-items: center; gap: 10px;
    text-transform: uppercase;
}
button[type="submit"]:hover { background: var(--asm-secondary); }

.asm-dark-btn { background: var(--asm-dark); width: auto; min-width: 180px; margin-top: 5px; }
.asm-dark-btn:hover { background: #000; }

/* --- Icons --- */
/* Checkmark */
.asm-icon-check {
    width: 70px; height: 70px; border-radius: 50%;
    border: 3px solid var(--asm-primary); position: relative;
    box-sizing: border-box;
}
.asm-icon-check::after {
    content: ''; position: absolute; left: 22px; top: 13px;
    width: 18px; height: 34px;
    border: solid var(--asm-primary); border-width: 0 4px 4px 0;
    transform: rotate(45deg);
}

/* Error X */
.asm-icon-error {
    width: 70px; height: 70px; border-radius: 50%;
    border: 3px solid #d93025; position: relative;
    box-sizing: border-box;
}
.asm-icon-error::before, .asm-icon-error::after {
    content: ''; position: absolute;
    top: 32px; left: 14px; width: 38px; height: 4px;
    background: #d93025; border-radius: 2px;
}
.asm-icon-error::before { transform: rotate(45deg); }
.asm-icon-error::after { transform: rotate(-45deg); }

/* --- Utils --- */
.asm-close-corner {
    position: absolute; top: 15px; right: 20px;
    font-size: 28px; color: #ccc; text-decoration: none;
    line-height: 1; transition: 0.2s; z-index: 10;
}
.asm-close-corner:hover { color: var(--asm-dark); }

.asm-home-link-bottom {
    display: block; margin-top: 25px; font-size: 14px;
    color: #888; text-decoration: none; text-align: center; font-weight: 500;
}
.asm-home-link-bottom:hover { color: var(--asm-primary); }

.asm-footer-link { margin-top: 20px; font-size: 14px; color: #666; text-align: center; }
.asm-footer-link a { color: var(--asm-primary); font-weight: 600; text-decoration: none; }

.asm-username-group { position: relative; text-align: left; }
#asm-username-msg { position: absolute; right: 12px; top: 17px; font-size: 12px; font-weight: 600; }

.asm-loader {
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%; border-top: 2px solid #fff;
    width: 16px; height: 16px;
    animation: spin 1s linear infinite; display: none;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- RESPONSIVE --- */
@media (max-width: 600px) {
    .asm-popup-container { padding: 30px 20px; }
    .asm-form-box h2 { font-size: 24px; margin-bottom: 10px; }
    .asm-grid { flex-direction: column; gap: 0; }
    .asm-icon-check, .asm-icon-error { width: 60px; height: 60px; }
    .asm-icon-check::after { left: 19px; top: 10px; width: 16px; height: 30px; }
    .asm-icon-error::before, .asm-icon-error::after { top: 27px; left: 11px; width: 34px; }
}