:root {
    --primary: #042e6f; /* RSA Deep Navy */
    --primary-light: #0d47a1;
    --accent: #ff8c00; /* RSA Orange */
    --accent-hover: #e67e00;
    --success: #10B981;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --bg-main: #F8FAFC;
    --bg-card: #FFF;
    --border: #E2E8F0;
    --shadow-sm: 0 4px 6px -1px rgb(0 0 0 / 5%), 0 2px 4px -1px rgb(0 0 0 / 3%);
    --shadow-lg: 0 20px 25px -5px rgb(4 46 111 / 15%), 0 10px 10px -5px rgb(4 46 111 / 10%);
    --star-default: #CBD5E1;
    --star-active: #ff8c00; /* RSA Orange for stars */
    --font-family: 'Plus Jakarta Sans', sans-serif;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

/* Background Elements */
.bg-elements {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    background: url('../img/login-bg.png') no-repeat center center/cover;
}

.bg-elements::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7); /* Black transparent */
}
.gradient-glow { display: none; }
.flight-path { display: none; }

.container {
    width: 100%;
    max-width: 640px;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeUp 0.8s ease-out forwards;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 2.5rem;
    width: 100%;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem 1rem;
    background: rgb(255 255 255 / 90%);
    border: 1px solid rgb(255 255 255 / 100%);
    border-radius: 30px;
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-sm);
}

.brand-icon {
    width: 24px;
    height: 24px;
    color: var(--accent);
}

.hero h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: #FFF;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 4px rgb(0 0 0 / 30%);
}

.hero p {
    color: rgb(255 255 255 / 85%);
    font-size: 1.05rem;
    max-width: 480px;
    margin: 0 auto;
    text-shadow: 0 1px 2px rgb(0 0 0 / 30%);
}

/* Main Rating Card */
.rating-card {
    background: var(--bg-card);
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    position: relative;
    border: 1px solid rgb(255 255 255 / 80%);
    backdrop-filter: blur(20px);
}

.hidden {
    display: none !important;
}

.form-section {
    margin-bottom: 1.75rem;
}

.form-row {
    display: flex;
    gap: 1.5rem;
}

.form-section.half {
    flex: 1;
}

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.help-icon {
    display: inline-block;
    width: 16px; height: 16px;
    background: var(--border);
    color: var(--text-muted);
    border-radius: 50%;
    text-align: center;
    font-size: 10px;
    line-height: 16px;
    cursor: help;
    margin-left: 4px;
}

/* Custom Select */
.custom-select {
    position: relative;
    width: 100%;
}

.select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-main);
    transition: var(--transition);
}

.select-trigger:hover, .select-trigger.active {
    border-color: var(--accent);
}

.select-trigger.active .arrow {
    transform: rotate(180deg);
}

.select-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    overflow: hidden;
}

.custom-select.open .select-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-box {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.search-box input {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
    font-family: inherit;
}

.search-box input:focus {
    border-color: var(--accent);
}

.options-list {
    max-height: 240px;
    overflow-y: auto;
}

.option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
}

.option:hover {
    background: var(--bg-main);
}

.inst-name {
    font-weight: 600;
    color: var(--primary);
}

.inst-join {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Selected Instructor Card */
.selected-inst-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgb(0 119 255 / 3%);
    border: 1px solid rgb(0 119 255 / 10%);
    border-radius: var(--radius-md);
    margin-top: 1rem;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.avatar-placeholder {
    width: 48px; height: 48px;
    background: rgb(0 119 255 / 10%);
    color: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-placeholder svg {
    width: 24px; height: 24px;
}

.selected-inst-card .name {
    font-weight: 600;
    color: var(--primary);
    font-size: 1.05rem;
}

.selected-inst-card .joining {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.selected-inst-card .joining strong {
    color: var(--text-main);
}

/* Inputs */
input[type="month"], textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-main);
    transition: var(--transition);
    outline: none;
}

input[type="month"]:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgb(0 119 255 / 10%);
}

/* Star Rating */
.text-center { text-align: center; }
.rating-label { font-size: 1.1rem; margin-bottom: 1rem; }

.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.star-rating input {
    display: none;
}

.star-rating label {
    cursor: pointer;
    width: 44px;
    height: 44px;
    color: var(--star-default);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.star-rating label svg {
    width: 32px;
    height: 32px;
    fill: currentcolor;
    transition: transform 0.2s;
}

/* Hover and active states for stars */
.star-rating label:hover svg,
.star-rating label:hover ~ label svg,
.star-rating input:checked ~ label svg {
    color: var(--star-active);
    transform: scale(1.15);
}

/* Subdued effect for stars before hovered */
.star-rating:hover label {
    color: var(--star-default) !important;
}

.star-rating:hover label:hover,
.star-rating:hover label:hover ~ label,
.star-rating input:checked ~ label {
    color: var(--star-active) !important;
}

.rating-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    height: 20px;
    font-weight: 500;
    transition: var(--transition);
}

/* Textarea */
.textarea-wrapper {
    position: relative;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.char-counter {
    position: absolute;
    bottom: 12px;
    right: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: #fff;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Buttons */
.submit-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
    overflow: hidden;
    position: relative;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgb(255 255 255 / 10%), transparent);
    transition: left 0.5s;
}

.submit-btn:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px var(--primary);
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover .btn-icon {
    transform: translateX(4px);
}

.btn-icon {
    transition: transform 0.3s;
}

.secondary-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1.5rem;
}

.secondary-btn:hover {
    background: var(--bg-main);
    border-color: var(--primary);
}

/* Success State */
.success-state {
    text-align: center;
    padding: 2rem 0;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.success-icon {
    width: 80px; height: 80px;
    margin: 0 auto 1.5rem;
    position: relative;
}

.plane-animation {
    position: absolute;
    color: var(--accent);
    width: 32px; height: 32px;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation: flyOut 1.5s ease-in-out forwards;
    z-index: 2;
}

@keyframes flyOut {
    0% { transform: translate(-100px, 100px) scale(0.5); opacity: 0; }
    30% { transform: translate(-10px, 10px) scale(1); opacity: 1; }
    50% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(100px, -100px) scale(0.5); opacity: 0; }
}

.checkmark-circle {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgb(16 185 129 / 10%);
    color: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: popIn 0.5s 1.2s ease-out forwards;
}

.checkmark-circle svg {
    width: 40px; height: 40px;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: drawCheck 0.4s 1.5s ease-out forwards;
}

@keyframes popIn {
    0% { opacity: 0; transform: scale(0.5); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes drawCheck {
    to { stroke-dashoffset: 0; }
}

.success-state h2 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.success-state p {
    color: var(--text-muted);
}

/* Footer */
footer {
    margin-top: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Mobile Responsiveness */
@media (width <= 640px) {
    .container { padding: 1.5rem 1rem; }
    .rating-card { padding: 1.5rem; }
    .form-row { flex-direction: column; gap: 0; }
    .hero h1 { font-size: 1.75rem; }
    .star-rating label { width: 40px; height: 40px; }
}
