/* Ultra-modern styling for 2025 look */

/* Base styling and fonts */
@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&family=Sarabun:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4285f4;
    --primary-dark: #3367d6;
    --primary-light: #8ab4f8;
    --primary-gradient: linear-gradient(135deg, #4285f4, #34a0f2);
    --success-color: #0F9D58;
    --error-color: #DB4437;
    --warning-color: #F4B400;
    --dark-color: #2c3e50;
    --light-color: #f8f9fa;
    --transition-bezier: cubic-bezier(0.25, 0.8, 0.25, 1);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 5px 20px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    --shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.2);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

/* Global styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Prompt', 'Sarabun', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    background-attachment: fixed;
    color: var(--dark-color);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Containers and layout */
.container {
    max-width: 800px;
    margin: 30px auto;
    padding: 0;
}

/* Card styling with neomorphism */
.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.5s var(--transition-bezier);
    border: none;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md), 
                inset 0 -3px 0 rgba(0, 0, 0, 0.05),
                0 1px 3px rgba(66, 133, 244, 0.1);
}

.card:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: var(--shadow-hover);
}

.card-body {
    padding: 2.5rem !important;
}

/* Logo styling */
.logo {
    width: 100%;
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
}

.logo::before {
    content: '';
    position: absolute;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(66, 133, 244, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 0;
    animation: pulse-light 4s infinite;
}

.logo img {
    width: 150px;
    height: auto;
    position: relative;
    z-index: 1;
    transition: all 0.5s var(--transition-bezier);
    filter: drop-shadow(0 5px 15px rgba(66, 133, 244, 0.3));
}

.logo img:hover {
    transform: scale(1.05) rotate(5deg);
    filter: drop-shadow(0 8px 25px rgba(66, 133, 244, 0.4));
}

@keyframes pulse-light {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.2); }
}

/* Headings and text */
h1, h2, h3, h4, h5, h6 {
    color: var(--dark-color);
    letter-spacing: -0.5px;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.75rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Form elements */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    border: 2px solid rgba(0, 0, 0, 0.08);
    background-color: rgba(255, 255, 255, 0.9);
    transition: all 0.3s var(--transition-bezier);
    font-size: 1rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(66, 133, 244, 0.25);
    background-color: #fff;
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: var(--dark-color);
    display: flex;
    align-items: center;
}

.form-text {
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.form-label .text-danger {
    font-size: 1.2em;
    margin-left: 0.25rem;
    vertical-align: middle;
    animation: pulse-subtle 2s infinite;
}

@keyframes pulse-subtle {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 1; transform: scale(1.1); }
}

/* Buttons */
.btn {
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s var(--transition-bezier);
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.3);
}

.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, #3367d6, #2980b9);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(66, 133, 244, 0.4);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-lg {
    padding: 1rem 2rem;
}

.btn i {
    margin-right: 0.5rem;
    font-size: 1.1em;
    vertical-align: middle;
}

/* Custom animations */
.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

.btn:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0) translate(-50%, -50%);
        opacity: 0.5;
    }
    100% {
        transform: scale(20) translate(-50%, -50%);
        opacity: 0;
    }
}

/* Message and result box */
.message, .result-box {
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-top: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s var(--transition-bezier);
}

.message {
    background-color: rgba(231, 243, 254, 0.7);
    border: 1px solid rgba(182, 212, 254, 0.7);
    color: #31708f;
}

.result-box {
    background-color: rgba(209, 231, 221, 0.7);
    border: 1px solid rgba(186, 219, 204, 0.7);
    box-shadow: var(--shadow-sm);
}

.result-box h3 {
    color: var(--success-color);
    border-bottom: 1px solid rgba(186, 219, 204, 0.7);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Input groups with icons */
.input-group {
    position: relative;
    transition: all 0.3s var(--transition-bezier);
}

.input-group .input-group-text {
    border-top-left-radius: var(--radius-sm);
    border-bottom-left-radius: var(--radius-sm);
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-right: 0;
    padding: 0.75rem 1rem;
    transition: all 0.3s var(--transition-bezier);
    background-color: rgba(255, 255, 255, 0.9);
}

.input-group .input-group-text i {
    font-size: 1rem;
    width: 1.2rem;
    text-align: center;
    transition: all 0.3s var(--transition-bezier);
}

.input-group .form-control,
.input-group .form-select {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
}

.input-group:focus-within .input-group-text {
    border-color: var(--primary-color);
    background-color: #fff;
}

.input-group:focus-within .input-group-text i {
    transform: scale(1.1);
    color: var(--primary-color) !important;
}

.input-group:hover .input-group-text i {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

/* Ensure proper validation display with input groups */
.was-validated .input-group .form-control:valid,
.was-validated .input-group .form-select:valid {
    border-color: #198754;
}

.was-validated .input-group .form-control:valid ~ .input-group-text,
.was-validated .input-group .form-select:valid ~ .input-group-text {
    border-color: #198754;
}

.was-validated .input-group .form-control:invalid,
.was-validated .input-group .form-select:invalid {
    border-color: #dc3545;
}

.was-validated .input-group .form-control:invalid ~ .input-group-text,
.was-validated .input-group .form-select:invalid ~ .input-group-text {
    border-color: #dc3545;
}

/* Adjust spacing for validation feedback with input groups */
.input-group + .invalid-feedback,
.input-group + .form-text {
    margin-top: 0.25rem;
}

/* Helper classes */
.text-muted {
    color: #6c757d !important;
}

.invalid-feedback {
    font-size: 0.85rem;
    color: var(--error-color);
    margin-top: 0.25rem;
}

/* Form group spacing */
.row > * {
    margin-bottom: 1rem;
}

/* Thai font import */
@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&family=Sarabun:wght@300;400;500;600;700&display=swap');

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-body {
        padding: 1.5rem !important;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(66, 133, 244, 0.5);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(66, 133, 244, 0.7);
}

/* Custom selection */
::selection {
    background-color: rgba(66, 133, 244, 0.2);
    color: var(--dark-color);
}

/* Required fields styling */
.required-fields-notice {
    animation: fadeIn 0.5s ease-in-out;
}