/* Your Original Layout Engine Base */
html { height: 100%; font-family: sans-serif; } 
*, :after, :before { box-sizing: border-box; } 
main, img, section { display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0 auto; text-align: center; } 
main form { max-width: 400px; width: 100%; } 
form, textarea { max-width: 400px; text-align: center; } 
main form input:invalid { outline: 2px solid #f00; color: #f00; } 

/* Refactored Form Input Formatting */
main form label { 
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 15px; 
    font-family: 'Verdana', 'Geneva', 'Arial', sans-serif;
    color: #386fa7;
    font-size: 14px;
    font-weight: bold;
    width: 100%;
}
main form input, main form select, main form textarea {
    width: 100%;
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: sans-serif;
    font-weight: normal;
    color: #333;
}
main form input[type="color"] {
    height: 35px;
    padding: 2px;
    cursor: pointer;
}

/* Shortcut Templates Panel Styling */
.template-wrapper {
    width: 100%;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.template-label {
    font-family: 'Verdana', sans-serif;
    color: #555;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.shortcut-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    width: 100%;
}
.btn-shortcut {
    background-color: #f0f4f8;
    color: #386fa7;
    border: 1px solid #cbdbe5;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.1s ease;
}
.btn-shortcut:hover {
    background-color: #386fa7;
    color: #ffffff;
    border-color: #386fa7;
}

/* Split Row for Color & Opacity */
.color-row {
    display: flex;
    justify-content: center;
    align-items: flex-end; 
    gap: 15px;
    width: 100%;
    margin-top: 15px;
}
.color-row label {
    margin-top: 0;
    flex: 1;
}
.color-row label.small-input {
    max-width: 100px;
    flex: 0 0 100px;
}

/* Tooltip Icon Trigger */
.tip {
    display: inline-block;
    position: relative;
    cursor: help;
    color: #8faecf;
    margin-left: 4px;
    font-weight: normal;
}
.tip:hover {
    color: #386fa7;
}

/* Tooltip Hover Overlay Box */
.tip::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    padding: 10px;
    background-color: #2c3e50;
    color: #ffffff;
    font-size: 12px;
    line-height: 1.4;
    font-weight: normal;
    text-align: center;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease-in-out;
    z-index: 99;
}
.tip::before {
    content: "";
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #2c3e50 transparent transparent transparent;
    opacity: 0;
    pointer-events: none;
    z-index: 99;
}
.tip:hover::after, .tip:hover::before {
    opacity: 1;
}

/* Styled CTA Button */
#downloadQR {
    width: 100%;
    max-width: 400px;
    background-color: #386fa7;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 12px 20px;
    font-family: 'Verdana', sans-serif;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(56, 111, 167, 0.15);
    transition: background-color 0.15s ease;
    margin: 15px 0;
}
#downloadQR:hover {
    background-color: #2a5582; 
}
#downloadQR:active {
    transform: scale(0.99);
}