/* Basic form styles */
#form-message {
    display: none;
    margin-top: 10px;
}
#form-message.success {
    color: green;
}
#form-message.error {
    color: red;
}

/* Button base styles (initial blue BG + black text) */
.submit-anim,.submit-anim:visited {
    background-color: #6EF2F7; /* Brand blue background */
    border: solid 2px #6EF2F7; /* Matching border */
    color: #000000; /* Black text */
    width: 220px; /* Fixed like CodePen */
    height: 60px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 15px;
    cursor: pointer;
    transition: background-color 0.4s ease, border-color 0.3s ease;
    position: relative;
    padding: 0;
    display: block; /* Block for auto-centering */
    margin: 0 auto; /* Center in form */
}

.submit-anim:focus{background-color:transparent;}

.submit-anim:hover {
    background-color: transparent; /* Transparent on hover */
    border-color: #6EF2F7; /* Keep blue border */
    color: #6EF2F7; /* Blue text for indicator */
}
.submit-anim:focus {
    outline: none;
}
.submit-anim::-moz-focus-inner {
    border: none;
    outline: none;
}
.submit-anim::before {
    content: '';
    display: block;
    position: absolute;
    width: 0;
    height: 0;
    border-radius: 50%;
    background-color: #6EF2F7; /* Brand blue */
    margin: auto;
    top: 0;
    bottom: 0;
    left: 50%; /* Horizontal center */
    transform: translateX(-50%); /* Offset for true center */
}
.submit-anim::after {
    content: '';
    display: block;
    position: absolute;
    width: 16px;
    height: 8px;
    border-left: solid 5px white;
    border-bottom: solid 5px white;
    opacity: 0;
    transform: rotate(-45deg);
    margin: auto;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}
.submit-anim span {
    display: block;
    line-height: 60px;
    text-align: center;
}

/* Success animation classes */
.submit-anim.circle {
    animation-delay: 500ms, 3000ms;
    animation-duration: 300ms, 800ms;
    animation-timing-function: ease-out, ease-in;
    animation-fill-mode: forwards, forwards;
    animation-name: circle, button_grow;
    display: block !important; /* Block for centering */
    margin: 0 auto !important; /* Center the 60px circle */
    box-sizing: border-box !important; /* Include border in width - fixes off-center */
}
.submit-anim.circle::before {
    animation-delay: 800ms;
    animation-duration: 2500ms;
    animation-timing-function: ease-out;
    animation-fill-mode: forwards;
    animation-name: grow;
}
.submit-anim.circle::after {
    animation-delay: 4500ms;
    animation-duration: 400ms;
    animation-timing-function: ease-out;
    animation-fill-mode: forwards;
    animation-name: check;
}
.submit-anim span.click {
    animation-delay: 0s, 600ms;
    animation-duration: 300ms, 100ms;
    animation-timing-function: ease-in-out, linear;
    animation-fill-mode: none, forwards;
    animation-name: bounce, disapear;
}

/* Failed state (red shake + pulse) */
.submit-anim.error {
    border-color: #e74c3c !important;
    background-color: rgba(231, 76, 60, 0.1) !important;
    color: #e74c3c !important;
    animation: shake 0.5s ease-in-out;
    display: block !important;
    margin: 0 auto !important; /* Center for failed too */
    box-sizing: border-box !important; /* Consistent sizing */
}
.submit-anim.error::before {
    background-color: #e74c3c !important;
    animation: grow 2500ms 0s ease-out forwards !important; /* Red pulse immediate */
    left: 50% !important; /* Ensure centered in error too */
    transform: translateX(-50%) !important;
}

/* Keyframes (fixed px for CodePen fidelity; orange border) */
@keyframes bounce {
  30% {
    font-size: 20px;
  }
}
@keyframes circle {
  100% {
    width: 60px; /* Fixed circle */
    border: solid 6px #6EF2F7; /* Orange border instead of yellow/gray */
    border-radius: 30px; /* Full circle radius */
  }
}
@keyframes disapear {
  100% {
    opacity: 0;
  }
}
@keyframes grow {
  99.9% {
    width: 60px;
    height: 60px;
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@keyframes button_grow {
  0% {
    border: solid 2px #6EF2F7; /* Brand blue */
    background-color: #6EF2F7;
    width: 60px; /* From fixed circle */
    border-radius: 30px; /* Start from circle radius */
  }
  100% {
    border: solid 2px #6EF2F7; /* Brand blue */
    background-color: #6EF2F7;
    width: 220px; /* To fixed full */
    border-radius: 15px; /* Back to pill shape */
  }
}
@keyframes check {
  25% {
    opacity: 1;
  }
  60% {
    opacity: 1;
    transform: scale(1.3) rotate(-45deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(-45deg);
  }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
