.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 6px 12px;
    background-color: #1e3a8a;
    border: none;
    outline: none;
    border-radius: 8px;
    cursor: pointer;
    min-width: 68px;
    height: 44px;
}

.button:active {
    background: #172e71;
}

.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.button__text {
    font-weight: 500;
    font-size: 15px;
    color: #ffffff;
    transition: all 0.2s;
    font-family: inherit;
}

/* Small-screen adjustments: tighter buttons */
@media (max-width: 639px) {
    .button {
        padding: 6px 10px;
        min-width: 56px;
        height: 40px;
    }

    .button__text {
        font-size: 13px;
    }

    .button--loading::after {
        width: 12px;
        height: 12px;
        border-width: 3px;
    }
}

.button--loading .button__text {
    visibility: hidden;
    opacity: 0;
}

.button--loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    border: 4px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: button-loading-spinner 1s ease infinite;
}

/* Form controls styled to visually match button sizing and rhythm */
.form-control {
    display: inline-block;
    box-sizing: border-box;
    padding: 6px 10px;
    height: 44px;
    min-height: 40px;
    border-radius: 8px;
    /* Match textarea/input border color so controls look consistent */
    border: 1px solid #D1D5DB; /* same as Tailwind's border-gray-300 */
    font-size: 15px;
    font-family: inherit;
    color: #111827; /* text-primary fallback */
    background-color: #ffffff;
    outline: none;
}

/* Lift the brand so the logo/title overlap the top bar slightly.
   Reduce the negative top offset so the logo sits a bit lower (adds visual margin from the top). */
.brand-wrap {
    position: relative;
    z-index: 30; /* sit on top of the top-bar */
    top: -4px; /* small overlap on very small screens (reduced to provide margin) */
}

@media (min-width: 640px) {
    .brand-wrap {
        top: -4px; /* slightly reduced overlap on sm+ screens */
    }
}

/* Prevent main content from colliding with the overlapped brand */
@media (min-width: 640px) {
    #main-content { padding-top: 0.5rem; }
}

.form-control:focus {
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
    border-color: #2563eb;
}

/* Slightly smaller controls on very small screens to match button adjustments */
@media (max-width: 639px) {
    .form-control {
        height: 40px;
        padding: 6px 8px;
        font-size: 13px;
    }
}

@keyframes button-loading-spinner {
    from {
        transform: rotate(0turn);
    }

    to {
        transform: rotate(1turn);
    }
}

/* screen-reader only helper */
.sr-only {
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

/* Error message styling */
.error-message {
    color: #dc2626;
    padding: 1rem;
    background-color: #fee;
    border-left: 4px solid #dc2626;
    border-radius: 4px;
    margin: 0.5rem 0;
}
