/* 1. GLOBAL FIX: Prevents padding from spilling over the edge */
* {
    box-sizing: border-box;
}

body {
    font-family: sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #f4f4f4;
    /* Clean up scrollbars on desktop */
    overflow: hidden; 
}

.form-container {
    background: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    
    /* FIX: Use 100% width but cap it at 320px for a neat card look */
    width: 100%;
    max-width: 320px; 
    
    min-height: 270px; /* THIS IS THE FIX */
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
}

/* FIX: Align Input width with Button width (100%) */
input {
    width: 100%; 
    padding: 10px; /* Slightly more breathing room */
    border: 1px solid #ddd;
    border-radius: 4px;
}

button {
    width: 100%;
    padding: 10px;
    border: none;
    background:#0000AF; /* Brand Blue */
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

button:hover {
    background-color: #000080; /* Darker Blue hover */
}

.message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
}
.success { color: #155724; background-color: #d4edda; }
.error { color: #721c24; background-color: #f8d7da; }


/* --- UNIVERSAL MOBILE OPTIMIZATIONS --- */
/* FIX: Lowered limit to 480px. 
   This ensures "Big App Mode" only triggers on actual phones, 
   not on your Desktop popup window. */
@media screen and (max-width: 480px) {
    body {
        width: 100% !important;
        min-width: 300px !important;
        margin: 0 auto !important; 
        
        display: flex;
        flex-direction: column;
        align-items: center;      /* Horizontal Center */
        justify-content: flex-start; /* Top Align (Keyboard safe) */
        
        padding: 20px;
        padding-top: 10vh;        /* 10% from top */
        min-height: 100vh;        
        overflow: auto; /* Re-enable scrolling for phones */
    }

    div, form, .container, #active-view, .ql-container {
        width: 100% !important;
        max-width: 500px !important; 
        margin: 0 auto; 
    }

    button, .btn, input, select, textarea {
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 15px;
        padding: 15px !important; 
        font-size: 16px !important; 
        height: auto !important;
    }
}