/* Custom Loyalty Prompts Styling

   Loaded by a <link> in the Scripts section of Register.cshtml, RegisterPop.cshtml
   and Manage/EditAccount.cshtml, so it lands AFTER the ~/Content/css bundle and
   wins over Site.css and oo-account.css at equal specificity. Keep it on the
   contract tokens or it will quietly undo them. */

.custom-loyalty-prompt {
    margin-bottom: 20px;
}

.custom-loyalty-prompt label {
    font-weight: 500;
    margin-bottom: 8px;
}

.custom-loyalty-prompt .text-danger {
    margin-left: 3px;
}

/* Error styling */
.custom-prompt-error {
    display: block;
    margin-top: 5px;
    font-size: var(--oo-text-sm);
}

/* The hex inside the background-image below is part of an embedded SVG asset,
   not a CSS colour declaration. A data URI cannot read a custom property. */
.form-control.is-invalid {
    border-color: var(--oo-danger);
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid:focus {
    border-color: var(--oo-danger);
    box-shadow: var(--oo-focus-ring);
}

/* Character counter styling */
.char-counter {
    display: block;
    margin-top: 5px;
    color: var(--oo-on-surface-muted);
}

.char-counter .char-count {
    font-weight: 500;
}

/* String (textarea) styling */
.custom-prompt-string {
    resize: vertical;
    min-height: 80px;
}

/* Date input styling */
.custom-prompt-date {
    max-width: 250px;
}

/* Number input styling */
.custom-prompt-number {
    max-width: 200px;
}

/* Boolean (checkbox) styling */
.custom-prompt-boolean {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
}

.form-check {
    margin-top: 8px;
}

.form-check-label {
    margin-left: 5px;
    cursor: pointer;
    font-weight: normal;
}

/* Selection (dropdown) styling */
.custom-prompt-selection {
    max-width: 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .custom-prompt-date,
    .custom-prompt-number {
        max-width: 100%;
    }
}

/* Small helper text styling */
.form-text {
    display: block;
    margin-top: 5px;
}

/* Focus states */
.custom-prompt-string:focus,
.custom-prompt-date:focus,
.custom-prompt-number:focus,
.custom-prompt-selection:focus {
    border-color: var(--oo-brand);
    outline: 0;
    box-shadow: var(--oo-focus-ring);
}

/* Required field indicator */
.custom-loyalty-prompt label .text-danger {
    font-size: 1.1em;
    vertical-align: top;
}

/* Animation for error messages. A customer who asks the operating system for
   reduced motion gets the message with no movement. */
@media (prefers-reduced-motion: no-preference) {
    .custom-prompt-error {
        animation: fadeIn 0.3s ease-in;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

