/* Auth Pages CSS - Common styles for Login and Register pages */

/* Base Styles */
body {
    font-family: sans-serif;
    background: #f5f5f5;
    margin: 0;
}

/* Container */
.box {
    max-width: 400px;
    margin: 50px auto;
    padding: 40px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Logo */
.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo img {
    max-width: 150px;
    height: auto;
}

/* Heading */
h1 {
    text-align: center;
    margin-bottom: 20px;
}

/* Tabs */
.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab.active {
    color: #4CAF50;
    border-bottom-color: #4CAF50;
    font-weight: 500;
}

/* Form Inputs */
input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Buttons */
button {
    width: 100%;
    padding: 12px;
    background: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background: #f9f9f9;
    color:#000;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Google/LinkedIn Buttons */
.google-btn {
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.google-btn:hover {
    background: #f5f5f5;
}

/* Divider */
.divider {
    text-align: center;
    margin: 20px 0;
    color: #999;
    font-size: 14px;
}

/* Messages */
.msg {
    margin-top: 10px;
    font-size: 14px;
}

/* Form Sections */
.form-section {
    display: none;
}

.form-section.active {
    display: block;
}

/* Link Button */
.link-btn {
    background: none;
    border: none;
    color: #4CAF50;
    cursor: pointer;
    font-size: 14px;
    padding: 5px;
    text-decoration: underline;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Phone Input Group */
.phone-input-group {
    display: flex;
    gap: 0;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: visible;
    transition: border-color 0.3s;
    position: relative;
}

.phone-input-group:focus-within {
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

/* Custom Country Selector */
.country-selector {
    flex: 0 0 100px;
    position: relative;
}

.country-selector-display {
    padding: 0px 10px;
    background: #f9f9f9;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    height: 46px;
    border-right: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
}

.country-selector-display:hover {
    background: #f0f0f0;
}

.country-selector-display .arrow {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #666;
    margin-left: 8px;
}

.country-selector-display.open .arrow {
    transform: rotate(180deg);
}

/* Dropdown Panel */
.country-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    min-width: 280px;
    background: #fff;
    border: 1px solid #4CAF50;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    max-height: 320px;
    overflow: hidden;
}

.country-dropdown.open {
    display: block;
}

.country-search {
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.country-search input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    margin: 0;
}

.country-search input:focus {
    outline: none;
    border-color: #4CAF50;
}

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

.country-option {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: background 0.2s;
}

.country-option:hover {
    background: #f5f5f5;
}

.country-option.selected {
    background: #e8f5e9;
}

.country-option .flag {
    font-size: 18px;
    width: 24px;
}

.country-option .code {
    color: #666;
    font-weight: 500;
    min-width: 45px;
}

.country-option .name {
    color: #333;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.no-results {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* Phone Number Input */
.phone-input-group input[type="tel"] {
    flex: 1;
    padding: 12px;
    border: none;
    border-left: none;
    margin: 0;
    border-radius: 0 4px 4px 0;
    font-size: 14px;
}

.phone-input-group input[type="tel"]:focus {
    outline: none;
}

.phone-input-group input[type="tel"]::placeholder {
    color: #999;
}

/* Loading indicator for auto-detection */
.country-selector-display.loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4CAF50;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
}
