/* HTML5 form validation style */
input.error {
  border-color: red; background-color: #ffe6e6;
}

/* ============================================================
   Submit button spinner (m-progress)
   - Triggered by JS in auth.html / panel.html layouts
   - Safari-safe: JS uses requestAnimationFrame (see layouts)
   ============================================================ */

@keyframes btn-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.m-progress {
    position: relative !important;
    color:       transparent !important;
    text-shadow: none        !important;
    /* CRITICAL: prevent color transition from delaying text hide.
       btn-primary has transition:color 0.2s which would show text
       fading over the spinner for 200ms without this. */
    transition:  none        !important;
}

.m-progress:hover,
.m-progress:active,
.m-progress:focus {
    cursor:     default !important;
    outline:    none    !important;
    box-shadow: none    !important;
}

/* Spinner arc — white arc for dark/primary buttons */
.m-progress::before {
    content: '';
    display: block;
    position: absolute;
    box-sizing: border-box;
    top:         50%;
    left:        50%;
    width:       22px;
    height:      22px;
    margin-top:  -11px;
    margin-left: -11px;
    border-radius: 50%;
    border:           3px solid rgba(255, 255, 255, 0.25);
    border-top-color: rgba(255, 255, 255, 0.9);
    animation: btn-spin 0.75s linear infinite;
}

/* Large buttons */
.btn-lg.m-progress::before {
    width: 28px;  height: 28px;
    margin-top: -14px;  margin-left: -14px;
    border-width: 3.5px;
}

/* Small buttons */
.btn-sm.m-progress::before {
    width: 18px;  height: 18px;
    margin-top: -9px;  margin-left: -9px;
    border-width: 2.5px;
}

/* Light / outline buttons — dark arc on white background */
.btn-outline-secondary.m-progress::before,
.btn-outline-primary.m-progress::before,
.btn-default.m-progress::before,
.btn-light.m-progress::before {
    border-color:     rgba(52, 63, 82, 0.2);
    border-top-color: rgba(52, 63, 82, 0.85);
}
