/* ==========================================================================
   Prestige 8 Solutions: notify a loss page
   Form fields, validation states and the success mark.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Form fields
   -------------------------------------------------------------------------- */

.field {
    position: relative;
}

.field-control {
    display: block;
    width: 100%;
    min-height: 3.6rem;
    padding: 1.5rem 1rem 0.5rem;
    border: 1px solid rgba(3, 7, 18, 0.16);
    border-radius: 12px;
    background: #FFFFFF;
    color: var(--void);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.4;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea.field-control {
    min-height: 8.5rem;
    padding-top: 1.7rem;
    resize: vertical;
}

select.field-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23030712' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.field-control:hover {
    border-color: rgba(3, 7, 18, 0.34);
}

.field-control:focus {
    outline: none;
    border-color: var(--sapphire);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.field-label {
    position: absolute;
    top: 1.1rem;
    left: 1rem;
    right: 2.5rem;
    font-size: 1rem;
    font-weight: 400;
    color: rgba(3, 7, 18, 0.56);
    pointer-events: none;
    transform-origin: left top;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: transform 0.2s var(--ease-out), color 0.2s ease;
}

.field-control:focus ~ .field-label,
.field-control:not(:placeholder-shown) ~ .field-label,
.field.is-floated .field-label {
    transform: translateY(-0.66rem) scale(0.78);
}

.field-control:focus ~ .field-label {
    color: var(--sapphire);
}

.field-control::placeholder {
    color: transparent;
    transition: color 0.2s ease;
}

.field-control:focus::placeholder {
    color: rgba(3, 7, 18, 0.32);
}

.field-tick {
    position: absolute;
    top: 1.2rem;
    right: 1rem;
    width: 1.15rem;
    height: 1.15rem;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.25s ease, transform 0.35s var(--ease-out);
    pointer-events: none;
}

.field-tick path {
    fill: none;
    stroke: var(--electric);
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    transition: stroke-dashoffset 0.4s var(--ease-out) 0.05s;
}

.field.is-complete .field-tick {
    opacity: 1;
    transform: scale(1);
}

.field.is-complete .field-tick path {
    stroke-dashoffset: 0;
}

.field-hint,
.field-error {
    margin: 0.4rem 0.15rem 0;
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.4;
}

.field-hint {
    color: rgba(3, 7, 18, 0.56);
}

.field-error {
    display: none;
    color: var(--danger);
}

.field.has-error .field-control {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.10);
}

.field.has-error .field-error {
    display: block;
}

.field.has-error .field-hint {
    display: none;
}

.field.has-error .field-label {
    color: var(--danger);
}

.check-row {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    cursor: pointer;
}

.check-row input {
    flex: none;
    width: 1.3rem;
    height: 1.3rem;
    margin-top: 0.1rem;
    border: 1px solid rgba(3, 7, 18, 0.3);
    border-radius: 6px;
    background: #FFFFFF;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.check-row input:checked {
    border-color: var(--void);
    background: var(--void) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.4l3 3 6-6.4' fill='none' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 0.9rem no-repeat;
}

.check-row.has-error input {
    border-color: var(--danger);
}

.button-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: spinner-turn 0.7s linear infinite;
}

@keyframes spinner-turn {
    to { transform: rotate(360deg); }
}

/* Animated success mark: the ring draws, then the tick. */
.success-mark circle,
.success-mark path {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
}

.success-mark circle {
    stroke: var(--electric);
    stroke-width: 3;
    transform: rotate(-90deg);
    transform-origin: center;
}

.success-mark path {
    stroke: var(--void);
    stroke-width: 4;
}

.success-mark.is-drawn circle {
    animation: success-draw 0.7s var(--ease-out) forwards;
}

.success-mark.is-drawn path {
    animation: success-draw 0.45s var(--ease-out) 0.55s forwards;
}

@keyframes success-draw {
    to { stroke-dashoffset: 0; }
}
